FROM CACHE - en_header

Pass value from KOA to React

Shopify Partner
15 1 5


I am trying to figure out how to get the locale value passed on from KOA to React.
Im using the Shopify CLI boiler plate code.

I manage to capture the value in this route which is triggered when redirected after auth.

router.get("/", verifyRequest(), async ctx => {
await handle(ctx.req, ctx.res);
ctx.respond = false;
ctx.res.statusCode = 200;
But I cannot figure out how I can access this value from the react part of the app. I tried with a cookie but it doesnt seem possible to set a cookie from the route giving the following error "Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client". 
What is the best way to pass this value?
Replies 0 (0)