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

Plans for React v19 Support #656

Open
vikiboss opened this issue Dec 6, 2024 · 6 comments
Open

Plans for React v19 Support #656

vikiboss opened this issue Dec 6, 2024 · 6 comments

Comments

@vikiboss
Copy link

vikiboss commented Dec 6, 2024

Following the recent release of React v19, is there any planned update to ensure compatibility with this latest version of React?

The current package.json within this library lists React as a peer dependency with the versions ^16.8.0 || ^17.0.0 || ^18.0.0, but it does not include the newly released React v19.

image

@suren-atoyan
Copy link
Owner

The new version with React v19 support will be released next week!

@suren-atoyan
Copy link
Owner

hi everyone 👋

please try out the v4.7.0-rc.0 version (use npm install @monaco-editor/react@next or yarn add @monaco-editor/react@next) and let us know here if you face any issues

@studiosciences
Copy link

v4.7.0-rc.0 is working great for me.

@princefishthrower
Copy link

princefishthrower commented Feb 1, 2025

Here's the list of breaking changes from the official React doc: https://react.dev/blog/2024/04/25/react-19-upgrade-guide

I've also just run the npx codemod@latest react/19/migration-recipe tool on a fresh pull of this repo; React's recommended way of seeing what needs to be changed. After running it, git diff yielded only the following:

diff --git a/demo/src/App.test.js b/demo/src/App.test.js
index a754b20..ea55705 100644
--- a/demo/src/App.test.js
+++ b/demo/src/App.test.js
@@ -1,9 +1,12 @@
+import { createRoot, createRoot } from "react-dom/client";
 import React from 'react';
 import ReactDOM from 'react-dom';
 import App from './App';
 
 it('renders without crashing', () => {
   const div = document.createElement('div');
-  ReactDOM.render(<App />, div);
-  ReactDOM.unmountComponentAtNode(div);
+  const root = createRoot(div);
+  root.render(<App />);
+  const root = createRoot(div);
+  root.unmount();
 });
diff --git a/demo/src/index.js b/demo/src/index.js
index 8e27b6d..1f0e292 100644
--- a/demo/src/index.js
+++ b/demo/src/index.js
@@ -1,3 +1,4 @@
+import { createRoot } from "react-dom/client";
 import React from 'react';
 import ReactDOM from 'react-dom';
 
@@ -9,7 +10,8 @@ import * as serviceWorker from './serviceWorker';
 
 import './index.css';
 
-ReactDOM.render(<Provider value={store}><App /></Provider>, document.getElementById('root'));
+const root = createRoot(document.getElementById('root'));
+root.render(<Provider value={store}><App /></Provider>);
 
 // If you want your app to work offline and load faster, you can change
 // unregister() to register() below. Note this comes with some pitfalls.

Looks like these two file changes only affect the demo files, and none of the src/

@rahulthewall
Copy link

v4.7.0-rc.0 works great here too so far.

Any idea when we can see v4.7.0?

@suren-atoyan
Copy link
Owner

v4.7.0-rc.0 works great here too so far.

Any idea when we can see v4.7.0?

v4.7.0 is coming next week

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

No branches or pull requests

5 participants