Skip to content

Instantly share code, notes, and snippets.

@buglessir
Last active October 28, 2019 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buglessir/99bd47a6190fe7d5dce12d79f378f7dd to your computer and use it in GitHub Desktop.
Save buglessir/99bd47a6190fe7d5dce12d79f378f7dd to your computer and use it in GitHub Desktop.
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