title: React(next.js) is giving me "handleSubmit is not defined"
body: <p>I used react Class components but know I want to use functions.
  And I have a problem because it keeps telling me that handleSubmit is not defined. BUT not in call but like in the beginning of function.</p>
  
  <p>This was correct.</p>
  
  <pre><code> class RegistrationForm extends React.Component {
   ........
        handleSubmit = e =&gt; {
          e.preventDefault();
          this.props.form.validateFieldsAndScroll((err, values) =&gt; {
            if (!err) {
              console.log('Received values of form: ', values);
            }
          });
        };
  ............
  render() {
  ..........
  return{
  ........
  }}
  </code></pre>
  
  <p>And i changed it to this</p>
  
  <pre><code>   const RegistrationForm = () =&gt; {
    ..........
      handleSubmit = e =&gt; {
        e.preventDefault();
      axioswal
        .post('/api/users', {
          firstname,
          secondname,
          email,
          password,
        })
        .then((data) =&gt; {
          if (data.status === 'ok') {
            dispatch({ type: 'fetch' });
            redirectTo('/');
          }
            });
        };
    .....
    return {
    ......
    }
  </code></pre>
  
  <p>And I am calling it here</p>
  
  <pre><code> return (
          &lt;Form {...formItemLayout} onSubmit={this.handleSubmit}&gt;
            &lt;Form.Item
            label={
  </code></pre>
  
  <p>But I don't know what to do to make it work.
  I will be thankful for any help.</p>