Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ReactDOM.render is no longer supported in React 18

import * as ReactDOMClient from 'react-dom/client';
import App from 'App';

const container = document.getElementById('app');

// Create a root.
const root = ReactDOMClient.createRoot(container);

// Initial render: Render an element to the root.
root.render(<App tab="home" />);

// During an update, there's no need to pass the container again.
root.render(<App tab="profile" />);
Source by itsjavascript.com #
 
PREVIOUS NEXT
Tagged: #longer #supported #React
ADD COMMENT
Topic
Name
6+7 =