When you setup a remix app you have a function "handleRequest" in the file "entry.server.tsx" and the fifth argument is "loadContext" but it is unused and from what i understand this is supposed to be used to pass global variables into the loader and action functions, is there any documentation on this subject ? The only documentation I can find use the express way. (i'm using remix serve)
#How do you declare and pass the loadContext ?
1 messages · Page 1 of 1 (latest)
You need to use getLoadContext in the http server (eg express)
So you can't do it with remix dev ?
remix dev is an embeded express server no?
We should be able to do it in the entry.server.tsx, the argument is even present in the handleRequest function...
Yeah you can’t with the Remix App Server, you need to switch to Express or another server
The whole point of loadContext is to let server pass data to your app
Ok! thanks
I think you want Server Context https://github.com/remix-run/remix/discussions/7644