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

chore(react): consistently import React from 'react' #3516

Closed
wants to merge 1 commit into from

Conversation

leyanlo
Copy link
Collaborator

@leyanlo leyanlo commented Jul 20, 2020

Consistently import React from 'react'. The * as React was only useful if we wanted to get the flow type from React, but we can get types directly from Flow without importing React, e.g. using React$Node or React$ElementRef. This also lets us remove imports from a few types.js files.

@vercel
Copy link

vercel bot commented Jul 20, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/uber-ui-platform/baseweb/f797ck65u
✅ Preview: https://baseweb-git-leyan-import-react.uber-ui-platform.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 20, 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.

Latest deployment of this branch, based on commit c006c0c:

Sandbox Source
Basic usage Configuration

Summary: Consistently import React from 'react'. The * as React was only useful if we wanted to get the flow type from React, but we can get types directly from Flow without importing React, e.g. using React$Node or React$ElementRef. This also lets us remove imports from a few types.js files.
@chasestarr
Copy link
Collaborator

Thanks for helping to standardize the source code here, but it looks like the import * pattern will the primary recommendation facebook/react#18102 I'm going to close for now, but let me know if there is a stronger reason for converting

@chasestarr chasestarr closed this Jul 20, 2020
@leyanlo
Copy link
Collaborator Author

leyanlo commented Jul 20, 2020

Thanks for helping to standardize the source code here, but it looks like the import * pattern will the primary recommendation facebook/react#18102 I'm going to close for now, but let me know if there is a stronger reason for converting

Oh wow didn’t realize they were moving away from default exports. Good to know!

@gergelyke gergelyke deleted the leyan/import-react branch July 31, 2020 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants