<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

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdn.tailwindcss.com
  2. https://unpkg.com/react@18/umd/react.development.js
  3. https://unpkg.com/react-dom@18/umd/react-dom.development.js
  4. https://cdnjs.cloudflare.com/ajax/libs/axios/0.27.2/axios.min.js