title: React - Form submission canceled because the form is not connected
body: <p>I want to get the value of input after submitting the form but code gives me the error - 'Form submission canceled because the form is not connected'. I know that if I change the button type from submit to button it will work, but I need submit method because on button click the other action is written and dont want to write code inside onclick function</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    updateItem(e) {
          // console.log(this.input.value);
          console.log(2222222222);
          e.preventDefault();
  
      }
  
      render() {
          return (
              &lt;div className='wrapper'&gt;
                  &lt;form onSubmit={this.updateItem}&gt;
                      &lt;input className='input'
                          type="text"
                          defaultValue={this.props.defValue}
                      // ref={(value) =&gt; {
                      //     this.input = value
                      // }}
                      /&gt;
                      &lt;button type="submit" 
                              className='submitButton' 
                              onClick{this.props.editItem}&gt;Update
                       &lt;/button&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          );
      }</code></pre>
  </div>
  </div>
  </p>