S
SolidJS•2y ago
sindre

Component is called twice when using Suspense, createResource and solid router

Hi I have a component that uses createResource. When navigating to a route containing this component, it's called (reevaluated?) twice. Is this what is supposed to happen when using transitions (which the router is using)? Or is it a bug? Is there some documentation for how Suspense is supposed to work? I can try to create a self-contained example if that makes it easier to understand my issue 🙂
1 Reply
sindre
sindreOP•2y ago
Update: Looks like there was a Show that reevaluated its children. Is that the correct behaviour? Especially since the cleanup was not called. (What is the correct way to load some data and then show the data when using Suspense. As far as I can understand, under Suspense I still need to guard against undefined values and return something else, since the content is evaulated)
Want results from more Discord servers?
Add your server