From 72604bd6673fc15ca0d9ec04c1da4730e19bfacc Mon Sep 17 00:00:00 2001 From: Hossein Dehnokhalaji Date: Sun, 10 Apr 2022 21:27:25 +0100 Subject: [PATCH 1/2] Update react peerDependencies --- package-lock.json | 6 +++--- package.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index de696a38..715b8105 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "notistack", - "version": "2.0.2", + "version": "2.0.3", "license": "MIT", "dependencies": { "clsx": "^1.1.0", @@ -46,8 +46,8 @@ "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@mui/material": "^5.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { "@emotion/react": { diff --git a/package.json b/package.json index 7d5ccd03..fb064319 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@mui/material": "^5.0.0", - "react": "^16.8.0 || ^17.0.0", - "react-dom": "^16.8.0 || ^17.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { "@emotion/react": { From dbf3e8a58434577dd06f07388b2c6b3cf14debb7 Mon Sep 17 00:00:00 2001 From: Hossein Dehnokhalaji Date: Sun, 10 Apr 2022 21:30:26 +0100 Subject: [PATCH 2/2] Update examples to use react 18 --- examples/mobx-example/index.js | 10 ++++++---- examples/redux-example/index.js | 10 ++++++---- examples/simple-example/index.js | 6 ++++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/examples/mobx-example/index.js b/examples/mobx-example/index.js index 6d15a6c4..40de9586 100644 --- a/examples/mobx-example/index.js +++ b/examples/mobx-example/index.js @@ -1,15 +1,17 @@ import React from 'react'; -import { render } from 'react-dom'; +import { createRoot } from 'react-dom/client'; import { Provider } from 'mobx-react'; import { SnackbarProvider } from 'notistack'; import store from './store/store'; import App from './App'; -render( +const container = document.getElementById('root'); +const root = createRoot(container); + +root.render( - , - document.getElementById('root'), + ); diff --git a/examples/redux-example/index.js b/examples/redux-example/index.js index d803ca3a..7d651e6b 100755 --- a/examples/redux-example/index.js +++ b/examples/redux-example/index.js @@ -2,7 +2,7 @@ * CREDIT to GitHub@natepage for this example */ import React from 'react'; -import { render } from 'react-dom'; +import { createRoot } from 'react-dom/client'; import { createStore, combineReducers } from 'redux'; import { Provider } from 'react-redux'; import { SnackbarProvider } from 'notistack'; @@ -11,11 +11,13 @@ import App from './App'; const store = createStore(combineReducers({ app: reducers })); -render( +const container = document.getElementById('root'); +const root = createRoot(container); + +root.render( - , - document.getElementById('root'), + ); diff --git a/examples/simple-example/index.js b/examples/simple-example/index.js index b597a442..48342b59 100644 --- a/examples/simple-example/index.js +++ b/examples/simple-example/index.js @@ -1,5 +1,7 @@ import React from 'react'; -import ReactDOM from 'react-dom'; +import { createRoot } from 'react-dom/client'; import App from './App'; -ReactDOM.render(, document.getElementById('root')); +const container = document.getElementById('root'); +const root = createRoot(container); +root.render();