We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 509f3df commit 295ca3aCopy full SHA for 295ca3a
extension/src/main.js
@@ -1,5 +1,6 @@
1
import React from 'react';
2
-import ReactDOM from 'react-dom';
+import { createRoot } from 'react-dom/client';
3
+
4
5
import { Provider } from 'react-redux';
6
@@ -23,10 +24,11 @@ const Main = function () {
23
24
};
25
26
window.reactMain = function () {
- ReactDOM.render(
27
- <Main />,
28
- document.getElementsByClassName('magicss-command-palette-root')[0]
29
- );
+ // https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html
+ const container = document.getElementsByClassName('magicss-command-palette-root')[0];
+ const root = createRoot(container); // createRoot(container!) if you use TypeScript
30
31
+ root.render(<Main />);
32
33
34
window.reactMain();
0 commit comments