-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
fix(plugin-react): wrong substitution causes React is not defined
#9386
Conversation
// Assume `Fragment` is equivalent to `React.Fragment` so modules | ||
// that use `import {Fragment} from 'react'` are reverse compiled. | ||
(component === 'Fragment' ? 'React.Fragment' : component) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is missing special handling for import { Fragment } from 'react'
usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it was handled 79ff627
Yes, updated. |
@aleclarson do you think this should be in a patch or in a minor for plugin-react? |
@patak-dev Patch, since this fixes intended behavior |
Description
fix: #9371
I don't think it's necessary to replace
reactAlias.createElement/Fragment
withReact.createElement/Fragment
before transform to jsx, which results in a lot of edge cases.We can just use
reactAlias
to determine if we can transform to jsx, which will also become faster!Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).