Skip to content

Support useWheelPicker in Picker component #2100

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

Merged
merged 2 commits into from
Jul 10, 2022

Conversation

ethanshar
Copy link
Collaborator

Description

Support useWheelPicker in Picker component
This should replace useNativePicker implementation

Changelog

Support useWheelPicker prop in Picker component in order to render a wheel picker component

@@ -137,7 +137,8 @@ export default class PickerScreen extends Component {
<Picker
title="Native Picker"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change the title too. Also, don't you want to keep both examples for native and wheel pickers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, I want to deprecate useNativePicker, you mean for the sake of sanity checks - to see nothing was broken with useNativePicker prop?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, if you're deprecating the 'useNativePicker' now there's no point having its example (but the title should be changed to avoid confusion).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -190,6 +197,8 @@ const Picker = (props: PropsWithChildren<PickerProps> & ForwardRefInjectedProps
return (
<PickerItemsList
testID={`${testID}.modal`}
useWheelPicker={useWheelPicker}
items={items}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't you pass 'items' only if 'useWheelPicker' is true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can add a condition, but it doesn't really matter or affect the code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's better to secure no side-effects

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@ethanshar ethanshar requested a review from Inbal-Tish June 26, 2022 09:26
@Inbal-Tish Inbal-Tish merged commit 4c3cf8e into master Jul 10, 2022
@ethanshar ethanshar deleted the feat/Picker_useWheelPicker branch April 2, 2024 06:38
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