Strange behavior around signals and client side routing
question
**Describe the bug**
There seems to be some weirdness with client side routing. I've come across two cases now where after navigating to a route, things don't work as expected, or they do and then don't work anymore after reloading the page.
One case is when an outer component spreads one of its props to a child component. The spread isn't recognized when you navigate to the page initially via client side routing, but it does run on reload.
~Another case is when a signal is called in an `Effect` from within an if statement. The effect doesn't run when the signal updates for some reason.~
Another case is when navigating to a route where a checkbox's `checked` attribute is controlled by a signal, on initial navigation the checkbox is reactive. After a page reload it is no longer reactive.
I made a small example here: https://github.com/adoyle0/leptos_effect_spread. The example happens to only use SSR but my project is equally broken in both SSR and CSR. I have a feeling these are related and are also related to #4622.
**Leptos Dependencies**
```toml
leptos = { version = "0.8.17", features = ["nightly"] }
leptos_router = { version = "0.8.13", features = ["nightly"] }
leptos_axum = { version = "0.8.8", optional = true }
leptos_meta = { version = "0.8.6" }
```
**To Reproduce**
Steps to reproduce the behavior:
1. run the example `cargo leptos watch`
2. Click on one of the links
3. read the page and observe behavior or inspect the element
4. reload the page
5. observe different behavior/output
**Next Steps**
- [ ] I will make a PR
- [x] I would like to make a PR, but need help getting started
- [x] I want someone else to take the time to fix this
- [x] This is a low priority for me and is just shared for your information
**Additional context**
I can dig into this further but I figure I'll start here in case someone more familiar with Leptos sees this and just already knows what it is and fixes it or can at least make a good guess. Or is this behavior desired/a consequence of something larger?
~Something really strange I just realized is that the example I made using the start_axum template has everything set at 0.8.0, which is a long time ago... But I swear these patterns worked until just recently, my code that broke is newer than 0.8.0, so maybe the cause of this is in some dependency? Or I'm going crazy~
Edit: disregard the Effect thing, I realized I needed to use `.get()` instead of `.get_untracked()` for the node_ref. The spreading issue remains and is probably not actually new. I've replaced the effect example with the reason why I wrote the effect in the first place and also updated all dependencies to their current versions
4 条评论