You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: This issue has nothing to do with any user-facing code. Priority should be given to other issues affecting users.
In a recent PR@AnnaTsu fixed a crucial issue regarding ConnectedRouter rendering on unrelated Redux store updates.
The work done in that PR did not address an ongoing double-render issue, however a future PR did. Both fixes are now merged into the master branch as of v6.1.0, and ConnectedRouter is now behaving as expected.
There is still an issue though. In PR 208, @AnnaTsu introduced a test to confirm that ConnectedRouteronly renders once on initialization:
it('only renders one time when mounted',()=>{// ... })
This test was passing, but it should've failed. Why? ConnectedRouter was still rendering twice on init. That issue was not addressed untilPR 218.
This test is creating a false positive.
Goal
We should aim to figure out why this test was not working as expected in PR 208, and fix it so that it does confirm ConnectedRouter only renders once on init.
In order to find the root cause of this problem, it's probably best to have the call to handleLocationChange inside of componentDidMount pass isFirstRendering = false to create a failing test:
This is just to "undo" the work done in PR 218, for testing purposes to confirm that the test fails. Once the test is red, revert the code and confirm the test passes.
These are just my initial thoughts on how to confirm a working test in the master.
The text was updated successfully, but these errors were encountered:
Note: This issue has nothing to do with any user-facing code. Priority should be given to other issues affecting users.
In a recent PR @AnnaTsu fixed a crucial issue regarding
ConnectedRouter
rendering on unrelated Redux store updates.The work done in that PR did not address an ongoing double-render issue, however a future PR did. Both fixes are now merged into the
master
branch as ofv6.1.0
, andConnectedRouter
is now behaving as expected.There is still an issue though. In PR 208, @AnnaTsu introduced a test to confirm that
ConnectedRouter
only renders once on initialization:This test was passing, but it should've failed. Why?
ConnectedRouter
was still rendering twice on init. That issue was not addressed until PR 218.This test is creating a false positive.
Goal
We should aim to figure out why this test was not working as expected in PR 208, and fix it so that it does confirm
ConnectedRouter
only renders once on init.In order to find the root cause of this problem, it's probably best to have the call to
handleLocationChange
inside ofcomponentDidMount
passisFirstRendering = false
to create a failing test:This is just to "undo" the work done in PR 218, for testing purposes to confirm that the test fails. Once the test is red, revert the code and confirm the test passes.
These are just my initial thoughts on how to confirm a working test in the
master
.The text was updated successfully, but these errors were encountered: