diff --git a/website/versioned_docs/version-0.61/segmentedcontrolios.md b/website/versioned_docs/version-0.61/segmentedcontrolios.md index b666b14cbe6..e53ae833ffb 100644 --- a/website/versioned_docs/version-0.61/segmentedcontrolios.md +++ b/website/versioned_docs/version-0.61/segmentedcontrolios.md @@ -14,18 +14,40 @@ The selected index can be changed on the fly by assigning the selectedIndex prop ## Example -```jsx - { - this.setState({selectedIndex: event.nativeEvent.selectedSegmentIndex}); - }} -/> +```SnackPlayer name=SegmentedControlIOS%20Example&supportedPlatforms=ios +import React, { useState } from "react"; +import { SegmentedControlIOS, StyleSheet, Text, View } from "react-native"; + +export default App = () => { + const [index, setIndex] = useState(0); + return ( + + { + setIndex(event.nativeEvent.selectedSegmentIndex); + }} + /> + + Selected index: {index} + + + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + padding: 24, + justifyContent: "center" + }, + text: { + marginTop: 24 + } +}); ``` -
- --- # Reference @@ -42,8 +64,6 @@ If false the user won't be able to interact with the control. Default value is t | ---- | -------- | | bool | No | -
- --- ### `momentary` @@ -54,8 +74,6 @@ If true, then selecting a segment won't persist visually. The `onValueChange` ca | ---- | -------- | | bool | No | -
- --- ### `onChange` @@ -96,8 +114,6 @@ Accent color of the control. | ------ | -------- | | string | No | -
- --- ### `values`