react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

Support optgroup for Picker

Open briankwlin opened this issue 3 years ago • 1 comments

The current picker doesn't support categories/groups of options as part of its props. It would be great to have support for the native optgroup element as part of react-native-web, or if that's not possible, any alternative solution anyone can suggest. Thanks (:

image

briankwlin avatar Feb 01 '22 04:02 briankwlin

Imo, Picker component (https://reactnative.dev/docs/picker) is being deprecated by the React Native team so it might not be worth adding the support. https://github.com/react-native-picker/picker is currently the alternative.

Perhaps you can just use plain HTML select (possibly in a platform specific file .web.js)? Note that optgroup is not available on ReactNative anyway should you ever integrate the app to mobile.

hoangvvo avatar Feb 09 '22 19:02 hoangvvo

Yeah migrate away from Picker and use platform-file forking if needed. We have some plans to make web a first-class API in React Native, which will make a lot of these things easier to do https://github.com/react-native-community/discussions-and-proposals/pull/496

necolas avatar Apr 13 '23 17:04 necolas