Skip to content
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

&& operator behavior #33

Open
ulugbekna opened this issue May 23, 2024 · 0 comments
Open

&& operator behavior #33

ulugbekna opened this issue May 23, 2024 · 0 comments
Assignees
Labels
under-discussion Issue is under discussion for relevance, priority, approach
Milestone

Comments

@ulugbekna
Copy link
Contributor

In react, it's common to write TSX as { myVar && <MyComponent myVar={myVar} />} for optional rendering.

We support such construct, but with current implementation

... 
return <> { '' && <MyComponent /> } </>; 

will return an empty string, which is quite error prone - I learned this from having a bug report.

This also differs from react behavior where { '' && <Component />} results in not rendering the component - ref.

Should we align react and our tsx behavior? @joyceerhl

@ulugbekna ulugbekna self-assigned this May 23, 2024
@ulugbekna ulugbekna added the under-discussion Issue is under discussion for relevance, priority, approach label May 23, 2024
@ulugbekna ulugbekna added this to the May 2024 milestone May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

1 participant