I was trying to setState using the radiobuttons in ReactJs but I dont know why this is not working, maybe I have something missing in my code
var handleRadio = (event)=>{
this.setState({views:event.target.value})
}
This is my Function "handleRadio"
<input
type="radio"
checked={this.state.views === "streets-v11"}
onClick={handleRadio}
value="streets-v11"
/> Street Map <br />
<input
type="radio"
checked={this.state.views === 'outdoors-v11'}
onClick={handleRadio}
value="outdoors-v11"
/> Topo Map <br />
<input
type="radio"
checked={this.state.views === 'satellite-v9'}
onClick={handleRadio}
value="satellite-v9"
/> Satellite Map
and that's my code for buttons.. I was trying to call the function on radio button click and then according to that I was trying to set the value of state but this code is not working to setState in my project What's Wrong in this code ? my state name is views initialized as an empty string....
Form.Checkwith normalinput