Created
March 29, 2021 13:05
-
-
Save code08-ind/f1a6b56669da448c457f4e44e25f3e53 to your computer and use it in GitHub Desktop.
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 React, { createContext } from 'react'; | |
import ComponentA from './ComponentA'; | |
const FirstName = createContext(); | |
const LastName = createContext(); | |
const UseContext = () => { | |
return ( | |
<> | |
<FirstName.Provider value={"Aryan"}> | |
<LastName.Provider value={"Garg"}> | |
<ComponentA/> | |
</LastName.Provider> | |
</FirstName.Provider> | |
</> | |
); | |
} | |
export default UseContext; | |
export { FirstName, LastName }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment