SnipZard
Search snippets
Home
Portfolio
Contact
useContext
The useContext hook is used to access the value of a React context.
Snippet:
const
contextValue
=
useContext
(
MyContext
)
;
Copy Code
Example:
const
theme
=
useContext
(
ThemeContext
)
;
Copy Code