NickN
tRPC3y ago
12 replies
Nick

Mutations and Queries in React Contexts causing unexpected behaviors

In my organization, we recently moved to put all of our mutations/queries into React Contexts and out of components (NextJS with React 18). I am now seeing requests and debouncing behaviors that used to work no longer work.

In some cases it appears we now have race conditions as loading/success are not necessarily being handled, but in other cases we're not getting reactivity from mutations that are in contexts

Anyone else have experience or tips re: throwing tRPC stuff into React Contexts?
Was this page helpful?