New ROOT API

Before

import ReactDOM from'react-dom';
import App from'App';
ReactDOM.render(<App />, document.getElementById('root'));

new

import ReactDOM from'react-dom';
import App from'App';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);

By switching to the new Root API, you will automatically get the new out-of-the-box features brought by React 18!

how to install?

Use the @alpha tag to install React 18 immediately

$ npm install react@alpha react-dom@alpha

It will take several months for Alpha to reach Beta, after which it will take more time to fully stabilize

点赞(0) 打赏

评论列表 共有 0 评论

暂无评论

微信服务号

微信客服

淘宝店铺

support@elephdev.com

发表
评论
Go
顶部