create_resource
+ <Router>
+ <Transition>
infinite loop bug
#1629
Labels
bug
Something isn't working
create_resource
+ <Router>
+ <Transition>
infinite loop bug
#1629
Describe the bug
Since the
v0.5.0-beta2
(I guess, I never had this problem before) I am experiencing a very annoying bug.You need the following situation:
<Transition>
blockLeptos Dependencies
Use the
start-axum
example as the base with leptosv0.5.0-beta2
To Reproduce
I created a minimal example based on the
start-axum
template which creates this bug for me every time.Basically, just paste the code into the
app.rs
. Everything is perfectly fine when you just hit F5 / refresh multiple times on both routes. My browser fully crashes each time, when I render the page and then navigate toPage 1
after the hydration on the client side has finished.You can see it easily if you just pull up a sys monitor and notice that 1 core is being utilized 100% all of the time, until the browser notifies me that the script is broken and I should kill it manually. During this time, everything inside the Transition block is being re-rendered as fast as the CPU can. This does not have any impact on the server side (I tested this with running the backend on another host), this happens only inside the browser.
As soon as you out-comment one of the resource
.get()
s, this does not happen any more.Another solution is to wrap a second
<Transition>
inside the first one. I don't know if this is the basic idea, that each resource read should be wrapped in its own transition or not, I never had this problem before. I am not sure if it is linked to the beta2 release.Expected behavior
Not having the browser crash each time.
EDIT:
In this example of course it would be a no brainer to just have 2 Transitions (even though it would be tedious). I stumbled acros this problem a few times now, when I basically have a main component which does some data fetching from various resources and then I want to use that data in multiple sub-components. To get around this, I always have to create an "in-between-component" which then wraps these values either into signals or stored values, which is a lot of additional code as well.
The text was updated successfully, but these errors were encountered: