Skip to content

Commit

Permalink
feat(react): remove unregisted event
Browse files Browse the repository at this point in the history
  • Loading branch information
zealotchen0 committed Oct 14, 2024
1 parent 26a9d93 commit 9c4891b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
29 changes: 15 additions & 14 deletions driver/js/packages/hippy-react/src/components/list-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -494,20 +494,21 @@ class ListView extends React.Component<ListViewProps, ListViewState> {
style = getFooterStyle();
}
if (typeof renderPullFooter === 'function') {
pullFooter = (
<PullFooter
// @ts-ignore
style={style}
key={'pull-footer'}
ref={(ref) => {
this.pullFooter = ref;
}}
onFooterPulling={onFooterPulling}
onFooterReleased={onFooterReleased}
>
{ renderPullFooter() }
</PullFooter>
);
const footerProps: any = {
style,
key: 'pull-footer',
ref: (ref) => {
this.pullFooter = ref;
},
};

if (typeof onFooterPulling === 'function') {
footerProps.onFooterPulling = onFooterPulling;
}
if (typeof onFooterPulling === 'function') {
footerProps.onFooterReleased = onFooterReleased;
}
pullFooter = <PullFooter {...footerProps}>{renderPullFooter()}</PullFooter>;
}
return pullFooter;
}
Expand Down
24 changes: 12 additions & 12 deletions driver/js/packages/hippy-react/src/components/waterfall-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -458,18 +458,18 @@ class WaterfallView extends React.Component<WaterfallViewProps> {
) {
let pullFooter: JSX.Element | null = null;
if (typeof renderPullFooter === 'function') {
pullFooter = (
<PullFooter
key={'PullFooter'}
ref={(ref) => {
this.pullFooter = ref;
}}
onFooterPulling={onFooterPulling}
onFooterReleased={onFooterReleased}
>
{ renderPullFooter() }
</PullFooter>
);
const footerProps: any = {
key: 'PullFooter',
ref: (ref) => {
this.pullFooter = ref;
},
onFooterReleased,
};

if (typeof onFooterPulling === 'function') {
footerProps.onFooterPulling = onFooterPulling;
}
pullFooter = <PullFooter {...footerProps}>{renderPullFooter()}</PullFooter>;
}
return pullFooter;
}
Expand Down

0 comments on commit 9c4891b

Please sign in to comment.