I\'ve been experimenting with React. In my experiement, I\'m using the Reactstrap framework.When I click a button, I\'ve noticed that the HTML form submits. Is there a way t
import React, { Component } from 'react';
export class Form extends Component {
constructor(props) {
super();
this.state = {
username: '',
};
}
handleUsername = (event) => {
this.setState({
username: event.target.value,
});
};
submited = (event) => {
alert(`Username: ${this.state.username},`);
event.preventDefault();
};
render() {
return (
);
}
}
export default Form;