<div id="app"></div>
const App = () => {
  const [str, setStr] = React.useState('Ray');
  const [num, setNum] = React.useState(0);
  const [bool, setBool] = React.useState(true);
  return (
    <div>
      <p>String Value:{ str }</p>
      <button type="button" onClick={ () => setStr('QQ') }>更改</button>
      <hr/>
      <p>Number Value:{ num }</p>
      <button type="button" onClick={ () => setNum(num + 1) }>更改</button>
      <hr/>
      <p>Boolean Value:{ bool.toString() }</p>
      <button type="button" onClick={ () => setBool(!bool) }>更改</button>
      <hr/>
    </div>
  )
}

const app = document.querySelector('#app');
const root = ReactDOM.createRoot(app);
root.render(<App />);
View Compiled

External CSS

  1. https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css

External JavaScript

  1. https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js
  2. https://unpkg.com/react@18/umd/react.development.js
  3. https://unpkg.com/react-dom@18/umd/react-dom.development.js