Skip to content

Commit

Permalink
chore(create-vite-app): upgrade react to 18 (#7597)
Browse files Browse the repository at this point in the history
Co-authored-by: Alec Larson <1925840+aleclarson@users.noreply.github.com>
  • Loading branch information
shahriar-shojib and aleclarson authored Apr 4, 2022
1 parent 45b9273 commit 8b21029
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions packages/create-vite/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"preview": "vite preview"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@types/react": "^17.0.33",
"@types/react-dom": "^17.0.10",
"@vitejs/plugin-react": "^1.0.7",
"typescript": "^4.5.4",
"vite": "^2.9.0"
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@vitejs/plugin-react": "^1.3.0",
"typescript": "^4.6.3",
"vite": "^2.9.1"
}
}
9 changes: 4 additions & 5 deletions packages/create-vite/template-react-ts/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'

ReactDOM.render(
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
)
10 changes: 6 additions & 4 deletions packages/create-vite/template-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"preview": "vite preview"
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^1.0.7",
"vite": "^2.9.0"
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@vitejs/plugin-react": "^1.3.0",
"vite": "^2.9.1"
}
}
9 changes: 4 additions & 5 deletions packages/create-vite/template-react/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'

ReactDOM.render(
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
)

0 comments on commit 8b21029

Please sign in to comment.