October 2019
Intermediate to advanced
426 pages
11h 49m
English
Before Hooks, if we wanted to encapsulate state management logic, we had to use higher-order components and render props. For example, we create a React component that uses contexts to deal with user authentication as follows:
import authenticateUser, { AuthenticationContext } from './auth'
const App = () => ( <AuthenticationContext.Consumer> {user =>
Read now
Unlock full access