title: Property in state becomes undefined within action creators
body: <p>I'm making an app where different users can add their own plants/flowers.
  The flowerlist contains the users flowers and loads these items upon mounting.</p>
  
  <pre><code>class flowerList extends Component {
  componentDidMount() {
      this.props.getFlowers();
  }
  </code></pre>
  
  <p>To send the correct GET request to the backend I need to have the currently logged in user's ID.
  This is what the called action creator looks like:</p>
  
  <pre><code>export const getFlowers = () =&gt; (dispatch, getState) =&gt; {
  dispatch(setFlowersLoading());
  axios
      .get(`/api/users/${getState().auth.user.id}/flowers`)
      .then((res) =&gt;
          dispatch({
              type    : GET_FLOWERS,
              payload : res.data
          })
      )
      .catch((err) =&gt; dispatch(returnErrors(err.response.data, err.response.status)));
  };
  </code></pre>
  
  <p>However, this doesn't work very well. It only works when coming directly from signing in. If I refresh the page, the app crashes with the error message "TypeError: Cannot read property 'id' of null". When writing the POST requests in a similar fashion it doesn't work well either, so I guess there must be a better way to access the state. I'd really appreciate any help in getting this to work.</p>