Work with expo
ariran5 opened this issue · 3 comments
ariran5 commented
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
balgamat commented
It doesn't for me, at least not in the web.
balgamat commented
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).