Last active
October 28, 2019 07:48
-
-
Save buglessir/99bd47a6190fe7d5dce12d79f378f7dd 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 from 'react'; | |
import { UserContext } from './components/User'; | |
class Profile extends React.Component { | |
render() { | |
return ( | |
<UserContext.Consumer> | |
{(user) => ( | |
<div> | |
<strong>Name: <strong> {user.name}<br /> | |
<strong>Title: <strong> {user.title}<br /> | |
<strong>URL: <strong> {user.url}<br /> | |
</div> | |
)} | |
</UserContext.Consumer> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment