Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

React render

// Before
import { render } from 'react-dom';
const container = document.getElementById('app');
render(<App tab="home" />, container);

// After
import { createRoot } from 'react-dom/client';
const container = document.getElementById('app');
const root = createRoot(container); // createRoot(container!) if you use TypeScript
root.render(<App tab="home" />);
Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #React #render
ADD COMMENT
Topic
Name
4+6 =