October 2019
Intermediate to advanced
426 pages
11h 49m
English
As you might have noticed, the CreatePost component still uses the hardcoded username. To be able to access the user value there, we need to move the Hook from the UserBar component, to the App component.
Let's refactor the definition of the user State Hook now:
const [ user, setUser ] = useState('')
export default function UserBar ({ user, setUser }) {
import React, { useState } from 'react'
const user = 'Daniel Bugl'
Read now
Unlock full access