You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some SolidJS control structures like <Show>...</Show> have the fallback property that allows rendering something when nothing matches the condition provided. But when the fallback gets complex, it becomes inconvenient and feels outright wrong to include full-blown JSX inside an attribute. Plus the formatting becomes weird too no matter what tools are used. I suggest making them a nested element instead, like this:
<Switch><Matchwhen={...}> ... </Match><Matchwhen={...}> ... </Match>
<!-- Show when none of the conditions match -->
<Fallback> ... </Fallback></Switch>
This would be a far better developer experience IMO.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Some SolidJS control structures like
<Show>...</Show>have thefallbackproperty that allows rendering something when nothing matches the condition provided. But when thefallbackgets complex, it becomes inconvenient and feels outright wrong to include full-blown JSX inside an attribute. Plus the formatting becomes weird too no matter what tools are used. I suggest making them a nested element instead, like this:This would be a far better developer experience IMO.
Beta Was this translation helpful? Give feedback.
All reactions