Tell us what’s happening:
Hey I took a freelance project using Bootstrap/SCSS in a Drupal CMS. Anyone have some good youtube videos or articles they could share? Thanks!
Your code so far
class MyForm extends React.Component {
constructor(props) {
super(props);
this.state = {
input: '',
submit: ''
};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleChange(event) {
this.setState({
input: event.target.value
});
}
handleSubmit(event) {
// change code below this line
event.preventDefault();
this.setState({input: '',
submit: this.state.input});
// change code above this line
}
render() {
return (
<div>
<form
onSubmit={this.handleSubmit}>
{ /* change code below this line */ }
<input
value= {this.state.input}
onChange ={this.handleChange}
{ /* change code above this line */ }
<button type='submit'>Submit!</button>
</form>
{ /* change code below this line */ }
<h1>{this.state.submit}</h1>
{ /* change code above this line */ }
</div>
);
}
};
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
.
Link to the challenge: