How to pass React state to multiple pages and components with Apollo Client

57 views Asked by At

I have some simple state defined using React useState:

const [showBanner, setShowBanner] = useState(true);

Then in a component I show or hide the banner:

{showBanner && <Banner onClick={() => setShowBanner(false)} />}

I need to pass this state to multiple pages and components. How can I do that with Apollo Client? Would using Reactive variables be an option?

0

There are 0 answers