August 2017
Beginner
374 pages
10h 41m
English
The last thing we need to do is show the currently logged-in user in the header. We will reuse the User component for this feature:
import User from './User.jsx'
const Header = ({ session }) => <div> { !session && <div><ConnectedRegistration /></div> } { !session && <div><ConnectedLogin /></div> } { session && <div> <b>Logged in as:</b>{' '} <User {...session} /> </div> } { session && <div><ConnectedCreatePost /></div> } </div>
Try to log in again, and you will now see who you are logged in as:
Read now
Unlock full access