Question from the React (legacy) test

How to submit a form in React

Medium
class MyForm extends React.Component{
    constructor(props){
        super(props);
        this.state={username: 'default name'};
    }
    
    render(){
        return(
           <form method="POST"action="/some/url">
               <label htmlFor="username">Your name:</label>
               <input type="text"name="username" id="username" value={this.state.username} />
               <button type="submit">SAVE</button>
           </form>
        )
    }
}

Check the valid proposal(s):

Author: Victor SabatierStatus: PublishedQuestion passed 1401 times
Edit
4
Community EvaluationsNo one has reviewed this question yet, be the first!