October 2017
Intermediate to advanced
302 pages
7h 27m
English
The code for UserContainer will be the same as ChatContainer, with two major differences:
Firstly, in App.js, convert the UserContainer route to use the render prop, the same as ChatContainer, and pass in the following props:
<Route path="/users/:id" render={({ history, match }) => ( <UserContainer messages={this.state.messages} messagesLoaded={this.state.messagesLoaded} userID={match.params.id} /> )}/>
Note that React Router automatically gives us the history and match props in our render method, which we use here to grab the user ID from the ...
Read now
Unlock full access