Replies: 1 comment 1 reply
-
I mean I could be that person and say you can do that already with children. <Show
when={}
children={}
fallback={}
/> It is interesting the idea of not using children purposefully and forcing a self-closing element. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using
<Show>
is a lot like using an if-statement.When having a fallback, I'd hope to get a feeling of using an "if {} else {}" statement, like a ternary ? : operator often used in JSX, but because the fallback has to be defined first, it ends up as an else {} if {}, which doesn't feel chronological, and porting a react app with many ternary operators to
<Show>
is quite daunting because it requires flipping the order of every single one, or negating all the conditions which likely will introduce bugs.A possible solution would be to add a content or template to
<Show>
Or even make it the primitive ternary
<If>
operator it basically is.Beta Was this translation helpful? Give feedback.
All reactions