react-native-ui-lib
react-native-ui-lib copied to clipboard
SegmentControl: Value is undefined, expecting a object
Description
When trying to use the SegmentControl
i get the following error
Related to
- [X] Components
- [ ] Demo
- [ ] Docs
- [ ] Typings
Steps to reproduce
Add <SegmentedControl segments={[{label: '1st'}, {label: '2nd'}]}/>
to your code
More Info
Code snippet
const Picker = <T extends unknown>(props: PickerProps<T>) => {
return <SegmentedControl segments={[{label: '1st'}, {label: '2nd'}]}/>
};
Screenshots/Video
Environment
- React Native: 0.63
- React Native UI Lib: 6.15.1
Affected platforms
- [ ] Android
- [X] iOS
- [ ] Web
Hi @Ulset,
Did you follow the installation guide here?
SegmentControl
requires the react-native-reanimated
and react-native-gesture-handler
libs.
Hey! Yes i did 😄
Hi,
Sorry for the delay.
I have a project with these:
"dependencies": {
"react": "17.0.2",
"react-native": "0.67.3",
"react-native-gesture-handler": "2.5.0",
"react-native-reanimated": "2.8.0",
"react-native-ui-lib": "^6.20.0"
},
I get no errors when adding the following to my App.js
:
<SegmentedControl segments={[{label: '1st'}, {label: '2nd'}]}/>