Created
September 4, 2020 14:42
-
-
Save manashcse11/a5f3402df43473f103bd22808878dfd7 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, { useContext } from 'react'; | |
import { UserContext } from '../UserContext'; | |
const ShowContextData = () => { | |
const user = useContext(UserContext); | |
return ( | |
<div> | |
<h3> | |
Showing from context | |
</h3> | |
<strong>Name</strong>: {user.name}<br/> | |
<strong>Profession</strong>: {user.profession} | |
</div> | |
); | |
}; | |
export default ShowContextData; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment