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
We’ve recently started migrating from ko-component-router to knockout-contrib-router and there are some things we noticed and wanted to know if they are bugs or behavior misunderstandings from our side.
Difficulties with the Path Binding (:heavy_check_mark: - @caseyWebb)
From the second router level below, we are no longer able to use the path bind ./, to access child routes, we must add the hardcoded path instead, or work around it using the canonicalPath.
This is indicated in the green/red text: https://p938k153rj.codesandbox.io/user/new/details
The path binding seems to work well for the first level, but not for the second and below.
Children component re-renders when clicking on href for the same route
From the second router level below, when we hit the same navigation item it re-renders the child component. This doesn’t happen at the top level.
In order to test this, click on the ‘Users’ link multiple times. You will notice that the first level “rendered at X ms message” is always the same. This is the expected behavior for me: clicking on the same link doesn’t trigger a re-rendering. It also works fine for the second level ‘New’ and ‘Edit’ navigation items.
But if you click on the ‘Details’ or ‘Contact’ the child component gets re-rendered, every time you click them.
Also, I’ve noticed that the first time I click on the ‘Users’ link the browser navigates to ‘/user’. The second time I click on it, the browser navigates to ‘/user/’.
Let me just say thank you for the router. The newer version is way better and a lot cleaner.
The text was updated successfully, but these errors were encountered:
Hey, thanks so much for the detailed report and test cases, really really going to be helpful. I think this is just the repro case I needed for an issue reported by someone else for the path binding.
I'll hopefully be able to dig into this tomorrow or Friday. I suspect that some of the changes I've been experimenting with locally may have the latent effect of resolving the path binding issue.
I've updated to rc.2 from my previous demo and tested the changes done in this last versions.
The problem with the 'Difficulties with the Path Binding' appears to be solved.
The only problem, from this issue, that isn't solved yet is 'Children component re-renders when clicking on href for the same route'.
I've also tested the /*option to add active-path class for any of the child routes opened and it works just as expected, it's nice to have this.
Hi Casey,
We’ve recently started migrating from ko-component-router to knockout-contrib-router and there are some things we noticed and wanted to know if they are bugs or behavior misunderstandings from our side.
I’ve created a codesandbox project where every single issue reported below can be reproduced. Here’s the demo link: https://p938k153rj.codesandbox.io/user
You can check the code at https://codesandbox.io/s/p938k153rj
Difficulties with the Path Binding (:heavy_check_mark: - @caseyWebb)
From the second router level below, we are no longer able to use the path bind ./, to access child routes, we must add the hardcoded path instead, or work around it using the canonicalPath.
This is indicated in the green/red text: https://p938k153rj.codesandbox.io/user/new/details
The path binding seems to work well for the first level, but not for the second and below.
Children component re-renders when clicking on href for the same route
From the second router level below, when we hit the same navigation item it re-renders the child component. This doesn’t happen at the top level.
In order to test this, click on the ‘Users’ link multiple times. You will notice that the first level “rendered at X ms message” is always the same. This is the expected behavior for me: clicking on the same link doesn’t trigger a re-rendering. It also works fine for the second level ‘New’ and ‘Edit’ navigation items.
But if you click on the ‘Details’ or ‘Contact’ the child component gets re-rendered, every time you click them.
Here is a sample video of this behavior: https://www.screencast.com/t/xmgbuWLKWav
Also, I’ve noticed that the first time I click on the ‘Users’ link the browser navigates to ‘/user’. The second time I click on it, the browser navigates to ‘/user/’.
Let me just say thank you for the router. The newer version is way better and a lot cleaner.
The text was updated successfully, but these errors were encountered: