-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
use_effect()
doesn't trigger when rendered via history::push()
#2848
Comments
Is there a branch on https://github.com/simbleau/website where I can see this live? I'm not certain which component contains the |
Can you confirm that this bug still persists with on master? A lot of changes to hooks and router have been made. |
It's not from my website , it's on a private repo. I invited you as a collaborator @WorldSEnder ) - It is irregular, though. When switching from http://localhost:8080/ to the next slide (http://localhost:8080/terminal) the effect is triggered appropriately. @hamza1311 Right now stylist isn't up to date for Yew 0.20 and this unfortunately causes 60+ errors on my side I'm not too keen on fixing. I've invited you as a collaborator to the repo, same as @WorldSEnder |
This is expected as history represents a setter and does not subscribe to changes. If you want to listen to location changes, you need to use the use_location hook. This is better represented in master as history is wrapped in the navigator type and no longer exposed directly. Navigator does not allow reading location information from it. |
Thanks @futursolo Is the appropriate fix then to use_location, or to upgrade to master? |
Yes. |
Going to close this, I have fixed the issue on my side. |
Problem
Steps To Reproduce
Expected behavior
use_effect()
should be triggered when I navigate to a page viahistory::push()
throughyew_router
Screenshots
If applicable, add screenshots to help explain your problem.
Expected:
Actual:
Environment:
19.3
1.63.1
wasm32-unknown-emscripten
trunk
Questionnaire
The text was updated successfully, but these errors were encountered: