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

fix: react-cons-elem should not hoist router comp #14828

Merged
merged 1 commit into from Aug 4, 2022

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Aug 4, 2022

Q                       A
Fixed Issues? Fixes #14363
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Thanks @budarin for the reproduction repo. It helps a lot. This PR is a follow-up to #14536. In this PR we set the initial value of the map HOISTED to be the jsxScope, which is the ancestry hoisting scope (if hoisted) or path.scope. Then we update HOISTED when it it actually hoisted. In this way, the Component in the test case won't be hoisted because its parent Route's hoisting scope is the BlockStatement, instead of the ArrowFunction to which we never hoisted due to no advantages.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories area: react i: regression labels Aug 4, 2022
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52674/

@JLHwung JLHwung merged commit 7fce737 into babel:main Aug 4, 2022
@JLHwung JLHwung deleted the fix-14363 branch August 4, 2022 21:28
@Nantris
Copy link

Nantris commented Aug 4, 2022

Thanks so much @JLHwung!

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: react i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
4 participants