sannajammeh / trpc-swr

tRPC-ified SWR hooks

Home Page:https://trpc-swr.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mutations on swr global config when using SWRConfig

briancoit opened this issue · comments

Mentioning here for visibility - I've opened #8 to fix an issue which currently seems to make this package largely incompatible with explicit use of <SWRConfig /> due to useContext().mutate calls mutating the global config rather than the nearest context.

Perhaps this would go unnoticed in a lot of applications (where TRPC procedure names are entirely unique and no "external" swr cache keys collide), but can lead to unexpected behaviours in applications where we have multiple TRPC clients that expose the same procedure names and have a requirement to isolate SWR caches.

Also, thanks for the creation of this package - very convenient!