January 2019
Intermediate to advanced
460 pages
10h 33m
English
Before implementing the routing, we will clean up the App.js file. Create a Main.js file next to the App.js file in the client folder. Insert the following code:
import React, { Component } from 'react';import Feed from './Feed';import Chats from './Chats';import Bar from './components/bar';import CurrentUserQuery from './components/queries/currentUser';export default class Main extends Component { render() { return ( <CurrentUserQuery> <Bar changeLoginState={this.props.changeLoginState}/> <Feed /> <Chats /> </CurrentUserQuery> ); }}
As you might have noticed, the preceding code is pretty much the same as the logged in condition inside the App.js file. The only change is that the changeLoginState function is ...
Read now
Unlock full access