import { useContext } from "react";
      
      const value = useContext(Context); 

      Typescript language logoNext useContext

      next
      context
      hook
      ...
      Next TypeScript recipes

      Accepts 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.

      Shortcut: next.hook.context.use

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.