useContext

The useContext hook is used to access the value of a React context.

Snippet:

const contextValue = useContext(MyContext);

Example:

const theme = useContext(ThemeContext);