#useQuery tracked properties proxy?

1 messages · Page 1 of 1 (latest)

brave forum
#

Default react-query uses a proxy-like setup to only re-render useQuery when one of the accessed properties are updated. Eg. Doing:

const { isLoading } = useQuery(...)

makes it so it only re-renders when isLoading changes. Blitz RPC breaks this behavior due to it accessing everything with a spread and returning it later. Is this something that we can fix? It makes for an awful lot of unnecessary re-renders

toxic surge
#

Hey @brave forum, would you mind making an issue for this in github?

I don't have an answer to fix this right now, but will try looking into this.

brave forum
toxic surge
brave forum
# toxic surge I don't think I follow, what you mean change the ts source?

Well, I tried to see if I can make it work by changing the node_modules source but the compiled code is so hard to follow that I cant really debug issues. So i was wondering if the test projects inside the Blitz source code allow me to change the actual source code while testing/working on it or if I have to change => compile => debug etc

toxic surge
#

You can also use pnpm dev to setup the dev watch of each file change so that you don't need to keep running pnpm build

#

Do let me know if you face any trouble setting it up locally.

brave forum
# toxic surge Hey you will need to change the required code and then `pnpm build` in the root ...
GitHub

⚡️ The Missing Fullstack Toolkit for Next.js. Contribute to blitz-js/blitz development by creating an account on GitHub.