title: code using useParams, useEffect and useState hooks
body: <p>Can someone please tell me the equivalent code using hooks for the following:</p>
  <pre><code>componentDidMount() {
    const { match: { params } } = this.props;
  
    axios.get(`/api/users/${params.userId}`)
      .then(({ data: user }) =&gt; {
        console.log('user', user);
  
        this.setState({ user });
      });
  }
  </code></pre>
  <hr />