Migration to v5
I'm currently testing migration to V5 and was wondering why if I run the codemod its not picking up that I'm using the old syntax when setting query keys. I receive a number of unmodified files., with 0 errors, 0 skipped and 0 ok. Is there something I'm doing wrong?
9 Replies
absent-sapphire•3y ago
What is the old syntax?
foreign-sapphire•3y ago
@HedgehogB FYI
like-goldOP•3y ago
@M00LTi sorry I should I have been more clear, version V5 has now kept one way of passing in query keys, one way was using an object and specfying querykey and queryfn, the other way was not using the object syntax. The code mod uses JScodeshift which checks the existing code to ensure react query code conforms to v5 standards. However, even if point the path to one ts file which is using the old syntax it doesn't fix it. I was wondering if I was doing something wrong.
ambitious-aqua•3y ago
Could you provide a code snippet, please? Did the codemod leave a message on the console about that the usage couldn’t be transformed?
like-goldOP•3y ago

ambitious-aqua•3y ago
Thank you! It will be fixed one of the next releases. I will ping you once the fix is merged.
adverse-sapphire•3y ago
@HedgehogB does this codemod also update isLoading -> isPending? thanks!
ambitious-aqua•3y ago
Not yet. That will be done by a different codemod. Hopefully it will released next week.
like-goldOP•3y ago
@HedgehogB thank you