-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Codemod to import * as React from "react"; #18102
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is the correct way to import React from an ES module since the ES module will not have a default export. Only named exports.
sebmarkbage
requested review from
threepointone,
bvaughn,
necolas,
gaearon,
trueadm,
lunaruan and
acdlite
February 22, 2020 03:23
facebook-github-bot
added
React Core Team
Opened by a member of the React Core Team
CLA Signed
labels
Feb 22, 2020
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
sebmarkbage
force-pushed
the
importstar
branch
from
February 22, 2020 03:27
245d280
to
3be66cf
Compare
lunaruan
approved these changes
Feb 22, 2020
As far I can tell this didn't change any bytes in the build. |
TrySound
added a commit
to jquense/react-big-calendar
that referenced
this pull request
Feb 22, 2020
Ref facebook/react#18102 Finally react team officially ditched default import.
TrySound
added a commit
to TrySound/react-beautiful-dnd
that referenced
this pull request
Feb 22, 2020
Ref facebook/react#18102 Also migrated from `import { type Node } from 'react';` to `React.Node` as more explicit because `Node` is also DOM type and may conflict when import is forgotted.
TrySound
added a commit
to TrySound/material-ui
that referenced
this pull request
Feb 22, 2020
1 task
TrySound
added a commit
to TrySound/svgr
that referenced
this pull request
Feb 23, 2020
TrySound
added a commit
to TrySound/svgr
that referenced
this pull request
Feb 23, 2020
"React es module will not have default export" |
ghost
mentioned this pull request
Jan 7, 2021
2 tasks
This was referenced Feb 18, 2023
mnvr
added a commit
to mnvr/mrmr.io
that referenced
this pull request
Mar 5, 2023
WillingDev0812
added a commit
to WillingDev0812/React-Big-Calendar
that referenced
this pull request
Oct 2, 2024
Ref facebook/react#18102 Finally react team officially ditched default import.
nickspaargaren
pushed a commit
to nickspaargaren/react-focus-lock
that referenced
this pull request
Dec 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the correct way to import React from an ES module since the ES module will not have a default export. Only named exports.
I'm doing some changes to named exports and this will stop working. For open source ES modules we'll probably publish some default object that warns as an upgrade path but we can't use that in our own code.