-
-
Notifications
You must be signed in to change notification settings - Fork 883
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
JSX does not wait for transitions to complete when using a ternary in a prop value #2161
Comments
This issue is probably a duplicate of: #1781. The problem is that the memo wrapping of the ternary isn't being read until in the renderEffect which is too late for the transition. Solid 2.0's design accounts for this specifically. |
Solid 2.0 looks promising, from what I've seen it will bring many improvements in the async department. So for now, it is better to avoid this pattern when reading resources that are part of a transition? Are there any other patterns to be aware of, that can have this problem? |
Yeah ternaries can be resolved inside out. It and boolean expressions are probably the only ones that apply that sort of optimization in the JSX that leads to that. They didn't always but I had changed it to fix another bug... the way we do normalization of insertion just needs to change in general. Other than that you don't want to read resources only effects. This almost never comes up but by that time it is too late. I guess this is true for Suspense as well so it isn't unique to Transitions. But a resource needs to be read in a computation (memo) or direct in JSX to trigger stuff. It can also be read in effects but it is the pure/immediate stuff that triggers suspense/transitions. |
Anyway I'm going to track the single issue. Thanks for reporting and I'm looking forward to getting this more streamlined. |
Describe the bug
When using a ternary expression as part of a prop value in JSX, transitions do not seem to work properly. The DOM is updated immediately, instead of waiting until all resources in the transition are resolved.
When not using a ternary, or moving it to a derived signal outside of the JSX, the transition works correctly.
Your Example Website or App
https://playground.solidjs.com/anonymous/f17b29b5-34f9-4cc5-af35-64c92380def3
Steps to Reproduce the Bug or Issue
Expected behavior
Under both 'Without ternary' and 'With ternary', the counts should wait for both resources to be resolved before updating the DOM.
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: