title: Uncaught TypeError: Cannot read property 'props' of undefined
body: <p>I am getting this error on my Addpage: </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'props' of undefined</p>
  </blockquote>
  
  <p>I am trying to go back from a component like in <a href="https://stackoverflow.com/questions/55048541/how-to-back-from-component-in-react-redux">this Stack Overflow post</a>.</p>
  
  <p>How do I go back from my Addpage?</p>
  
  <pre><code>const onClick = () =&gt; {
      this.props.dispatch({ type: 'AMENITIES_BACK', id: roomsManager.items.parentId })
  }
  
  const AmenitiesAdd = ({ handleSubmit, pristine, reset, submitting }) =&gt; {
      return (
          &lt;form onSubmit={handleSubmit(onSubmit)}&gt;
              &lt;Field label="amenities" name="newAmenities" component={InputText} validate={validateNotEmpty} type="text" /&gt;
              &lt;Field label="description" name="newDescription" component={InputText} validate={validateNotEmpty} type="text" /&gt;
              &lt;button type="submit"&gt;Submit&lt;/button&gt;
              &lt;button type="button" onClick={onClick}&gt;Back&lt;/button&gt;
          &lt;/form&gt;    
      );
  }
  
  export default reduxForm({
      form: 'AmenitiesAdd'
  })(AmenitiesAdd)
  </code></pre>