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