segmented-control
segmented-control copied to clipboard
Work with expo
please add to docs, expo users can
import SegmentedControl from '@react-native-segmented-control/segmented-control/js/SegmentedControl.js';
<SegmentedControl
style={{
width: 300,
height: 32
}}
values={['One', 'Two']}
selectedIndex={selectedIndex}
onChange={(event) => {
setState(event.nativeEvent.selectedSegmentIndex);
}}
/>
and it works
It doesn't for me, at least not in the web.
Ok, so the key to making this work is to strip away the flow types. Either with babel or webpack (depending on your bundler and platform).
@balgamat thank you!!!!!!