title: How do I get user id in my component to be able to dispatch to the action
body: <p>I want to show user feed and his posts. I'm planning to dispatch an action from componentDidMount of the UserPosts component but don't have the id now. The component looks like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>import React, { Component } from "react"
  import { getUserposts } from "../actions/userActions"
  
  class UserPosts extends Component {
  
    componentDidMount() {
      //////
    }
  
    render() {
      return (
        &lt;div className="card"&gt;
          &lt;div className="card-content"&gt;
            &lt;div className="media"&gt;
              &lt;div className="media-left"&gt;
                &lt;figure className="image is-48x48"&gt;
                  &lt;img
                    src="https://bulma.io/images/placeholders/96x96.png"
                    alt="Placeholder image"
                  /&gt;
                &lt;/figure&gt;
              &lt;/div&gt;
              &lt;div className="media-content"&gt;
                &lt;p className="title is-4"&gt;&lt;/p&gt;
                &lt;p className="subtitle is-6"&gt;&lt;/p&gt;
              &lt;/div&gt;
            &lt;/div&gt;
  
            &lt;div className="content"&gt;Insert Bio&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      )
    }
  }
  
  export default UserPosts
  </code></pre>
  
  <p>and the action like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>export const getUserposts = (id) =&gt; {
      return async dispatch =&gt; {
        dispatch({
          type: "FETCHING_POSTS",
        })
        try {
          const res = await axios.get(
            `http://localhost:3000/api/v1/users/posts/${id}`, {
              headers: {
                "Content-Type": "application/json"
              }
            }
          )
          dispatch({
            type: "FETCHING_POSTS_SUCCESS",
            data: res.data
          })
        } catch(err) {
          dispatch({
            type: "FETCHING_POSTS_ERROR",
            data: { error: res.data.error}
          })
        }
      }
    }
  </code></pre>
  
  <p>Now how do i get the id? I have a route that gives me the current logged in user. It's the <code>/me</code> route. I have set up on top of my <code>App.js</code>, so it runs on every refresh. So, is it possible to first dispatch for the <code>/me</code> route, grab the id, and then dispatch again for the <code>getUserPosts</code> action. How do I dispatch two actions from the componentDidMount?</p>
  
  <p>Is this feasible.</p>
  
  <pre class="lang-js prettyprint-override"><code>componentDidMount() {
     const authToken = localStorage.getItem("authToken");
     this.props.dipsatch(getCurrentUser(authToken)) // this will return the current user object
     this.props.dispatch(getUserPosts(id)) // i will probably get this id from the props from the 
                                              //redux store
  }
  
  Please tell how can I approach this? Thanks.
  </code></pre>