react-codemod icon indicating copy to clipboard operation
react-codemod copied to clipboard

Add support for React 18 features

Open rao123dk opened this issue 3 years ago • 0 comments

Possible Add

  • Updates to Client Rendering API (React 18)
// 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);
root.render(<App tab="home" />);

Note:- Its is useful for someone who is following micro-frontend architecture.

rao123dk avatar Mar 30 '22 15:03 rao123dk