My dropdown is showing and there is no syntax error but import ReactDOM from ‘react-dom’; is never read.
This is my code below.
import React, { Fragment } from 'react';
import ReactDOM from 'react-dom';
import { Helmet } from 'react-helmet';
import { Link } from 'react-router-dom';
import backbtn from '../assets/img/backbtn.png';
class Setting extends React.Component {
constructor(props) {
super(props);
this.state = {value: ''};
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmit(event) {
alert('Your favorite flavor is: ' + this.state.value);
event.preventDefault();
}
handleChange = event => {
this.setState({value: event.target.value});
};
render() {
return (
<Fragment>
<Helmet><title>Settings</title></Helmet>
<div id = "settings">
<section>
<div className ="image">
<Link to="/"><img src={backbtn} alt="back" /></Link>
</div>
<h3>Settings</h3>
<div className="music-container">
<ul>
<li>Want to know more about Covid-19?</li>
<li>Click these link below!</li>
</ul>
</div>
<form onSubmit={this.handleSubmit}>
<label>
Pick your favorite flavor:
<select value={this.state.value} onChange={this.handleChange}>
<option value="grapefruit">Grapefruit</option>
<option value="lime">Lime</option>
<option value="coconut">Coconut</option>
<option value="mango">Mango</option>
</select>
</label>
<input type="submit" value="Submit" />
</form>
</section>
</div>
</Fragment>
);
}
}
export default Setting;