mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00
updates to react 18 method createRoot
This commit is contained in:
parent
21a6a0587c
commit
5dc2d5efba
1 changed files with 6 additions and 2 deletions
8
index.js
8
index.js
|
@ -1,6 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import reactDom from 'react-dom';
|
// import reactDom from 'react-dom'; ---> deprecated
|
||||||
|
import { createRoot } from 'react-dom/client';
|
||||||
import App from './src/App';
|
import App from './src/App';
|
||||||
import './src/style.css';
|
import './src/style.css';
|
||||||
|
|
||||||
reactDom.render(<App />, document.getElementById('root'));
|
const container = document.getElementById('root');
|
||||||
|
const root = createRoot(container); // createRoot(container!) if you use TypeScript
|
||||||
|
// reactDom.render(<App />, document.getElementById('root'));
|
||||||
|
root.render(<App />);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue