-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
在 ListView 中使用时,传过来的 getScrollContainer 第一次必然得到 undefined,第二次渲染才会使用 ListView 提供的 container,且第二次渲染不会自动触发,在 onTouchMove 等事件产生导致重新渲染时会导致 DOM 结构整体变化,以及 children 被重新创建 / 渲染。
m-pull-to-refresh/src/PullToRefresh.tsx
Line 297 in e60268f
| if (getScrollContainer()) { |
相关:#171
workaround:
const MyPullToRefresh = ({ getScrollContainer, ...props }) => (
<PullToRefresh
getScrollContainer={() => getScrollContainer?.() || true}
{...props}
/>
);由于 getScrollContainer 被 ListView 覆盖了,因此只能自己包一个 MyPullToRefresh,保证返回值非 undefined。
Metadata
Metadata
Assignees
Labels
No labels