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(create-vite-app): upgrade react to 18 #7597

Merged
merged 5 commits into from
Apr 4, 2022

Conversation

shahriar-shojib
Copy link
Contributor

@shahriar-shojib shahriar-shojib commented Apr 3, 2022

Description

Upgrades react to v18.0.0 in template-react & template-react-ts in create-vite-app package.

fixes #7519

Additional context

React recently released v18 with concurrent features, this PR aims to provide vite template with concurrent features enabled.
In addition to using react concurrent features, this PR adds @types/react and @types/react-dom in the template so that the users can get better Intellisense and automatic imports when using template-react.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link
Member

@aleclarson aleclarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait until CRA updates their templates, so we can reference that as the canonical style guide.

"@vitejs/plugin-react": "^1.3.0",
"vite": "^2.9.1",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are out of order (alphabetically)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the ordering

aleclarson
aleclarson previously approved these changes Apr 3, 2022
@aleclarson aleclarson removed the on hold label Apr 3, 2022
@patak-dev
Copy link
Member

I'm getting a type error when building:

src/main.tsx:6:21 - error TS2345: Argument of type 'HTMLElement | null' is not assignable to parameter of type 'Element | DocumentFragment'.
  Type 'null' is not assignable to type 'Element | DocumentFragment'.

6 ReactDOM.createRoot(document.getElementById('root')).render(

aleclarson
aleclarson previously approved these changes Apr 3, 2022
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
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.

Reactjs 18
4 participants