import * as React from 'react'; import { View } from 'react-native'; export type Props = { /** * Function to execute on selection change. */ onValueChange: (value: string) => void; /** * Value of the currently selected radio button. */ value: string; /** * React elements containing radio buttons. */ children: React.ReactNode; }; export type RadioButtonContextType = { value: string; onValueChange: (item: string) => void; }; export const RadioButtonContext = React.createContext( null as any ); /** * Radio button group allows to control a group of radio buttons. * * ## Usage * ```js * import * as React from 'react'; * import { View } from 'react-native'; * import { RadioButton, Text } from 'react-native-paper'; * * const MyComponent = () => { * const [value, setValue] = React.useState('first'); * * return ( * setValue(newValue)} value={value}> * * First * * * * Second * * * * ); * }; * * export default MyComponent; *``` */ const RadioButtonGroup = ({ value, onValueChange, children }: Props) => ( {children} ); RadioButtonGroup.displayName = 'RadioButton.Group'; export default RadioButtonGroup; // @component-docs ignore-next-line export { RadioButtonGroup };