I'm new in full stack developing and I'm trying to code something to understand better frontend with React JS and Material UI. I've written a Dialog to send a post to backend and I tried to some radios to select each values, but they do not valorized properly. I'm new in this, so be patient, I'show you my code:
class NewAdv extends Component {
state = {
open:false,
type:'Sell',
body:'',
errors:{}
};
radioChange = (event) => {
this.setState({type: event.target.value});
console.log(this.state.type)
};
render() {
return (
<RadioGroup aria-label="Type" name="type" color="primary" value={this.state.type} onChange={this.radioChange}>
<FormControlLabel type="Sell" control={<Radio />} label="Sell" />
<FormControlLabel type="Trade" control={<Radio />} label="Trade" />
<FormControlLabel type="Other" control={<Radio />} label="Other" />
</RadioGroup>
)
}
How can I do?