Skip to content
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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Conversation

wangshunnn
Copy link
Collaborator

@wangshunnn wangshunnn commented Dec 16, 2024

No description provided.

@wangshunnn wangshunnn requested a review from hiyuki December 16, 2024 08:05
return index * itemRawH
}, [itemRawH])

const stableResetScrollPosition = useStableCallback((y: number) => {
Copy link
Collaborator

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(
Copy link
Collaborator

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)
Copy link
Collaborator

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
Copy link
Collaborator

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'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要在这里单独parse,都应该走统一的getStyle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants