Next.js Discord

Discord Forum

useSWR not working with parallel routes

Unanswered
Somali posted this in #help-forum
Open in Discord
SomaliOP
I have a cart component that is used in a modal window using parallel routes, as well as on the cart page itself.
I take the cart data from the React context, inside of which I use the useSWR hook to get the cart data. The problem is that when I open a modal window using parallel routs, the data from useSWR is not loaded immediately. I need to switch tabs or trim the swr in some other way, but this does not work on Mount. What could be the reason?

0 Replies