-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat rn picker-view #1760
base: master
Are you sure you want to change the base?
Feat rn picker-view #1760
Conversation
packages/webpack-plugin/lib/runtime/components/react/mpx-picker-view-column-item.tsx
Outdated
Show resolved
Hide resolved
packages/webpack-plugin/lib/runtime/components/react/mpx-picker-view-column-item.tsx
Show resolved
Hide resolved
packages/webpack-plugin/lib/runtime/components/react/mpx-picker-view-column.tsx
Outdated
Show resolved
Hide resolved
packages/webpack-plugin/lib/runtime/components/react/mpx-picker-view-column.tsx
Outdated
Show resolved
Hide resolved
packages/webpack-plugin/lib/runtime/components/react/mpx-picker-view-column.tsx
Outdated
Show resolved
Hide resolved
packages/webpack-plugin/lib/runtime/components/react/mpx-picker-view-column.tsx
Show resolved
Hide resolved
return index * itemRawH | ||
}, [itemRawH]) | ||
|
||
const stableResetScrollPosition = useStableCallback((y: number) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个useStableCb是干嘛用的
const paddingHeight = useMemo( | ||
() => Math.round((pickerH - itemHeight) / 2), | ||
[pickerH, itemHeight] | ||
) | ||
|
||
const snapToOffsets = useMemo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
无效的useMemo
onMomentumScrollEnd({ nativeEvent: { contentOffset: { y } } }) | ||
} | ||
}) | ||
const debounceResetScrollPosition = useDebounceCallback(stableResetScrollPosition, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10ms能有效果么?感觉不用debounce,维护一个状态标记已经进行过reset就行了吧
* ✘ indicator-class | ||
* ✘ mask-style | ||
* ✔ mask-style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mask-class和indicator-class需要编译支持一下,参考hover-class
const indicatorStyle = parseInlineStyle(props['indicator-style']) | ||
const pickerMaskStyle = parseInlineStyle(props['mask-style']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要在这里单独parse,都应该走统一的getStyle
No description provided.