react-native-web
react-native-web copied to clipboard
Support optgroup for Picker
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 (:
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.
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