A self-serializing/deserializing CSRF token provider that works for isomorphic applications.
yarn add @shopify/react-csrf-universal-provider
// App.tsx
import {CsrfUniversalProvider} from '@shopify/react-csrf-universal-provider';
function App({token}: {token?: string}) {
return (
<CsrfUniversalProvider value={token}>
{/* rest of the app */}
</CsrfUniversalProvider>
);
}