Created
June 18, 2022 08:01
-
-
Save GuillaumeDaviid/da85da7fee4a02c25ee62a103810a51a to your computer and use it in GitHub Desktop.
hooks: example 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createContext } from 'react' | |
export const YourContext = createContext(); | |
export const YourProvider = ({children}) => { | |
// traitement de vos data | |
return ( | |
<YourProvider.Provider value = {{value}}> | |
{children} | |
</YourProvider.Provider> | |
)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment