title: Submit form on radio button select in React
body: <p>I currently have several radio button forms which are submitting data to my backend nicely when i hit the return key. However I want each form to submit and move to the next component/form as soon as a radio button is selected. Is there a way to submit a form and move to the next component on radio button selection?
  Can onselect be used here, and if so how do i go about using it?</p>
  
  <p>Here's my code: </p>
  
  <pre><code>export class ChoiceOne extends React.Component {
      constructor(props) {
          super(props);
          this.state = {
              value: null
          };
  
          this.handleChange = this.handleChange.bind(this);
          this.handleSubmit = this.handleSubmit.bind(this);
      }
  
      handleChange = (e) =&gt; {
          const colourType = e.target.value;
          this.setState({
              colourType
          });
      };
  
  
      handleSubmit(event) {
          event.preventDefault();
  
          const typeOneItem = {
              time: new Date().toLocaleString("en-gb"),
              typeOne: this.state.colourType
          };
          firebase.writeTo(`${firebase.getCurrentUser().uid}/typeOne`, typeOneItem);
          this.props.onChosen(1);
      }
  
      render() {
              const colour = ['Red', 'Blue', 'Green'];
              return (
  
                      &lt;
                      div className = "type1" &gt;
                      &lt;
                      div className = "content" &gt;
                      &lt;
                      form onSubmit = {
                          this.handleSubmit
                      } &gt;
  
                      {
                          colour.map((colour, index) =&gt;
                              &lt;
                              label key = {
                                  index
                              } &gt; {
                                  colour
                              } &lt;
                              input value = {
                                  colour.toUpperCase()
                              }
                              checked = {
                                  this.state.colourType === colour.toUpperCase()
                              }
                              onChange = {
                                  this.handleChange
                              }
                              type = "radio" / &gt;
                              &lt;
                              /label&gt;
                          )
                      } &lt;
                      input type = "submit"
                      hidden / &gt;
                      &lt;
                      /form&gt; &lt; /
                      div &gt; &lt;
                      /div&gt;
  </code></pre>