rerender test
Hey there, currently the tanstack router does not seem to support testing rerender of hooks from:
import { renderHook } from '@testing-library/react'
I made a PR/fix https://github.com/TanStack/router/pull/2796
What is the correct process to get it approved?
We have a repo with over 300000 lines of code and heavily depend on our unit/integration tests to pass, our hooks have some rather simple but powerful rerender tests since it can prove no state changes are done as part of a rerender - but tanstack router seems to block that untill this PR is merged...
GitHub
Allow rerender by mta-trackunit · Pull Request #2796 · TanStack/rou...
This changes so Tanstack router will support rerenders in tests using the renderHooks from testing library.
import { renderHook } from '@testing-library/react'
We heavily depend on ...
3 Replies
stormy-gold•10mo ago
I still don't understand what this re-render test does
but we can't remove the memos
as you saw, this kills all render optimizations
eager-peachOP•10mo ago
The re-render test just checks that state does not change and effect other parts of the system - if all hooks can survive a rerender without sideeffects then you have a very stabile system.
stormy-gold•10mo ago
if you can find a way that does not disable the render optimizations we can go forward with this