<div id="root">
</div>
const List = () => {
return (
<ul>
<li>這是列表</li>
</ul>
)
}
const App = () => {
return (
<div>
<h1>Hello React</h1>
<List/>
</div>
)
}
const root = ReactDOM.createRoot(document.querySelector('#root'));
root.render(<App />);
View Compiled
This Pen doesn't use any external CSS resources.