Why not develop a Babel plugin that defines rules to identify JSX expressions containing ternary operators and automatically convert them into <Show> components? #2430
Closed
robertpanvip
started this conversation in
General
Replies: 2 comments
-
We already do this. Can you provide a n example where it doesn't work as you expect? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@robertpanvip |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Hello everyone,
While developing with SolidJS, I noticed that using ternary operators for conditional rendering in JSX can lead to components being recreated every time the condition changes. To address this issue, SolidJS provides the
<Show>
component for efficient conditional rendering.However, manually replacing ternary operators with the
<Show>
component in existing code can be cumbersome and error-prone. Therefore, I suggest developing a Babel plugin that automatically identifies and converts ternary operators in JSX to the<Show>
component structure.The main features of this plugin would include:
<Show>
component structures.I believe this plugin can help developers write high-performance SolidJS applications more easily.
Beta Was this translation helpful? Give feedback.
All reactions