Skip to content

Instantly share code, notes, and snippets.

@jamiehaywood
Created November 22, 2020 23:17
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 jamiehaywood/89d2e8c86576a85de52e5ffdc23992ad to your computer and use it in GitHub Desktop.
Save jamiehaywood/89d2e8c86576a85de52e5ffdc23992ad to your computer and use it in GitHub Desktop.
import React from "react";
import { useGlobalState } from "./GlobalStateProvider";
const PageTwo = () => {
const { state } = useGlobalState();
return (
<div>
<h1>State from PageOne:</h1>
<h2>Name:</h2>
<p>{`${state.firstname} ${state.lastname}`}</p>
<h2>Age:</h2>
<p>{state.age}</p>
</div>
);
};
export default PageTwo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment