You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the document Sharing Context Between action and loader, the context value set in the action phase can be used in the loader.
I assumed that the request in the action phase and the request in the revalidation phase were separate, and thus the context would be independent for each. Is that not the case? How is this possible? (My apologies if this question sounds strange, as I'm new to this topic.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
According to the document Sharing Context Between action and loader, the context value set in the action phase can be used in the loader.
I assumed that the request in the action phase and the request in the revalidation phase were separate, and thus the context would be independent for each. Is that not the case? How is this possible? (My apologies if this question sounds strange, as I'm new to this topic.)
I followed the example in the document, but the loader only contains the default value instead of the value set in the action. Did I do something wrong? Repro: https://stackblitz.com/edit/github-165puddz?file=app%2Froutes%2Fhome.tsx
Is there any point in setting the context value within the loader/action instead of the middleware?
Beta Was this translation helpful? Give feedback.
All reactions