How can I use Typescript to type case the onChange "event"?
I've tried using (event: NativeEvent)
as onChange={(event: NativeEvent) => setSegmentIndex(event.nativeEvent.selectedSegmentIndex)}
, but no luck.
SegmentedControl.tsx
<SegmentedControl values={['Active', 'Expired']} selectedIndex={segmentIndex} onChange={(event) => setSegmentIndex(event.nativeEvent.selectedSegmentIndex)}/>