0
1
JRJose Romero
nextcontexthookβ’β’β’
Next TypeScript recipesAccepts a context object (the value returned fromReact.createContext) and returns the current context value for that context. The current context value is determined by the value prop of the nearest above the calling component in the tree.
Library: next
Shortcut: next.hook.context.use
import { useContext } from "react";
const value = useContext(Context);