import * as React from 'react' import {FlatList, Text, TouchableWithoutFeedback, View} from 'react-native' import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons' // Styles interface MaterialRadioGroupProps { data: any, color: string, textFont?: string, textColor?: string, isRtl?:boolean, onItemPress?(item, index): void } interface MaterialRadioGroupState { selected: number } export default class MaterialRadioGroup extends React.Component { constructor(props) { super(props); this.state = { selected: -1 } } static defaultProps = { onItemPress: () => {}, textColor:'black' }; render() { return ( index.toString()} renderItem={({item, index}) => this.renderListItems(item, index)} /> ) } renderListItems = (item, index) => { return ( !this.props.isRtl? this.onItemPress(item, index)}> {item.text} : this.onItemPress(item, index)}> {item.text} ) }; onItemPress = (item, index) => { this.setState({selected: index}); this.props.onItemPress(item, index); } }