-
Notifications
You must be signed in to change notification settings - Fork 85
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
Triggering state changes as part of an on_visit handler #123
Comments
Yeah you're running into this: percy/examples/isomorphic/app/src/lib.rs Lines 83 to 86 in e41857e
Which was recently discovered by @austinsheep I haven't yet thought about what changes in state management approach could fix this problem - so for now you might just use the same requestAnimationFrame strategy. Open to any ideas you have of course! I'll leave this issue open as this is definitely a problem that should be resolved! |
More context Basically percy/examples/isomorphic/app/src/store.rs Lines 25 to 34 in e41857e
|
Should've read the comments. Makes sense! Thank you |
If you don't mind - going to keep this open until we land on a better way to handle this scenario which, like you said, other people will surely run into. Thanks! |
Hi!
I'd like to trigger a change to state (in this case, to hide an element) when a page is visited. To do so I put a
.msg()
in anon_visit
handler, like so:Expected behavior
Page loads and the element I've specified is hidden as a result of the above message being sent
Actual behavior
This runtime error:
Minimal Reproducible Example
In the
isomorphic example
, you can reproduce by changingdownload_contributers_json
to send a message like so:Notes
From reading a little bit about the error is that it's more of an
Rc/RefCell
problem than apercy
problem. I thought would be useful to post it here anyways because I imagine others will get snagged on it at some point.The text was updated successfully, but these errors were encountered: