Skip to content

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.
@leyanlo leyanlo force-pushed the leyan/import-react branch from cb236a6 to c006c0c Compare July 20, 2020 09:30
@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.

3 participants