How to implement radio button in React Native

前端 未结 8 2327
不思量自难忘°
不思量自难忘° 2020-12-25 11:18

I am converting React code to React Native. So I need to implement radio buttons.

8条回答
  •  一整个雨季
    2020-12-25 12:18

    I use Checkbox in react-native for creating the radio button. Please refer below code.

    constructor(props){
        super(props);
        this.state = {radioButton:'value1'};
    }
    render(){
        return(
            
                 this.setState({radioButton: 'value1'})}
                    >
                 this.setState({radioButton: 'value2'})}
                    > 
                 this.setState({radioButton: 'value3'})}
                    > 
                 this.setState({radioButton: 'value4'})}
                    > 
                 this.setState({radioButton: 'value5'})}
                    >  
    
            
        );
    }
    

提交回复
热议问题