webpack打包react出错

代码:

var React = require('react');
React.render(<div>test</div>,    
document.getElementById('box')
);

怎么会报
Warning: React.render is deprecated. Please use ReactDOM.render from require('react-dom') instead.


沧海一幻觉
浏览 1225回答 3
3回答

慕田峪4524236

var&nbsp;React&nbsp;=&nbsp;require('react'); var&nbsp;ReactDOM&nbsp;=&nbsp;require('react-dom'); ReactDOM.render( &nbsp;&nbsp;&nbsp;&nbsp;<div>test</div>,&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;document.getElementById('box')
打开App,查看更多内容
随时随地看视频慕课网APP