-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange behavior on Dropdown Link item #3593
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
We don't have time to debug your code, please make a minimal repro case. |
I've made a sandbox but I can not reproduce my issue. But while I was trying things, I found that when I removed the lazy load of route, it seems to fix the bug..
And if I just impor it :
I have no more error... |
It looks like the same thing as in: #3562 (comment). As I understand the fix was not released yet: facebook/react#15312 |
Ok I thought this fix was released. |
Bug Report
Using a Dropdown with options as Link, I get the error in a specific case :
Uncaught Invariant Violation: Unable to find node on an unmounted component
.Context :
I use react-router-dom
I've built a Header with Menu component.
The first Menu.Item is a header with a Link to /
The second item is a Component I made which handle a Dropdown Menu with few options, each options is also a Link:
Steps
1.When I'm on route "/" and I refresh the browser and try to click on one item from the dropdown menu, it fails with the error I've pasted upside.
2. If I refresh the browser, being on the route "/administration/users", I get the expected page.
3. Then If I click on the Header Item, I go to / as expected.
4. Then I can now navigate finely to /administration/* without errors.
5. If I refresh again from everywhere, the Dropdown Link Items fails again.
I tried to create a Menu.Item with one of the route in the Dropdown options, and I have no issue with it.
Each time I refresh my browser, the Dropdown Links does not work until I navigate first to a Link outside dropdown menu.
Expected Result
I should not have any errors in routing with Dropdown Item.
Actual Result
As far I do not refresh the page, routing works, but if I refresh the browser, I need to go on / before moving onto routes accessible from dropdown items.
Version
react-router-dom: 5.0.0
react: 16.8.6
semantic-ui: 2.4.2,
semantic-ui-react: 0.86.0
Testcase
If needed, I'll try to make a testcase
The text was updated successfully, but these errors were encountered: