Skip to content

Do not consider empty jsx expressions semantically important children #41166

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

Merged
merged 3 commits into from
Oct 19, 2020

Conversation

weswigham
Copy link
Member

Fixes #41125

This also extracts some repeated logic into a helper.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Oct 19, 2020
@@ -0,0 +1,19 @@
// @jsx: react,react-jsx,react-jsxdev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are react/react-jsx/react-jsxdev meaningfully different for this change? Or does this just help coverage some other way?

It was harder to read the baselines since they were in triplicate.

Copy link
Member Author

@weswigham weswigham Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! The JS output is different for each! In react createElement is used, with arrays or singleton children. In react-jsx, the jsx and jsxs ctors are toggled between based on if the child is detected as singleton or not (in addition to array/no array in the actual argument). In react-jsxdev, the isStatic parameter passed to the ctor is changed based on weather a singleton child is detected or not. So there's meaningful output to check for all 3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comment in JSX counted as a child when it shouldn't be
3 participants