I'm using ES6 babel with react, and now for the newer version react, react DOM is not a part of it anymore. My doubt for below code is that, is it the first line require? since nowhere I need React, but the last line I need ReactDOM.
const React = require('react')
const ReactDOM = require('react-dom')
const App = () => {
return (
<div className='app-container'>
<div className='home-info'>
<h1 className='title'>sVideo</h1>
<input className='search' type='text' placeholder='Search' />
<button className='browse-all'> or Browse All</button>
</div>
</div>
)
}
ReactDOM.render(<App />, document.getElementById('app'))
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…