Skip to content

Commit

Permalink
[Close #263] Upgrade to React 18 (#298)
Browse files Browse the repository at this point in the history
* Tentative update to React and React dom

* New React 18 createRoot syntax

* Run prettier to fix src/index.js formatting
  • Loading branch information
canjalal authored Jun 8, 2023
1 parent a05e47b commit b43b9bc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"postcss": "^8.4.14",
"postcss-cli": "^10.0.0",
"prop-types": "^15.8.1",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router": "^5.3.3",
"react-router-dom": "^5.3.3",
"react-scripts": "5.0.1",
Expand Down
10 changes: 6 additions & 4 deletions client/src/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import App from './App';
import { ContextProvider } from './Context';
import * as serviceWorker from './serviceWorker';

ReactDOM.render(
const rootElement = document.getElementById('root');
const root = ReactDOM.createRoot(rootElement);

root.render(
<React.StrictMode>
<ContextProvider>
<App />
</ContextProvider>
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);

// If you want your app to work offline and load faster, you can change
Expand Down
31 changes: 13 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8740,15 +8740,13 @@ react-dev-utils@^12.0.1:
strip-ansi "^6.0.1"
text-table "^0.2.0"

react-dom@^16.14.0:
version "16.14.0"
resolved "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz"
integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==
react-dom@^18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.19.1"
scheduler "^0.23.0"

react-error-overlay@^6.0.11:
version "6.0.11"
Expand Down Expand Up @@ -8863,14 +8861,12 @@ react-use-websocket@^2.9.1:
resolved "https://registry.npmjs.org/react-use-websocket/-/react-use-websocket-2.9.1.tgz"
integrity sha512-jV6OxXuxWi6BiPVlbAJd/uWNaoQwkeGARFO9f6HidJeWUatB4J2UopbxI/fduiGpcpHGhRAmpLdfVjeRzrcTnQ==

react@^16.14.0:
version "16.14.0"
resolved "https://registry.npmjs.org/react/-/react-16.14.0.tgz"
integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==
react@^18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"

read-cache@^1.0.0:
version "1.0.0"
Expand Down Expand Up @@ -9233,13 +9229,12 @@ saxes@^5.0.1:
dependencies:
xmlchars "^2.2.0"

scheduler@^0.19.1:
version "0.19.1"
resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz"
integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==
scheduler@^0.23.0:
version "0.23.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

schema-utils@2.7.0:
version "2.7.0"
Expand Down

0 comments on commit b43b9bc

Please sign in to comment.