<div id="app"></div>
body {
  padding: 20px;
}

.input-group {
  width: 300px;
}

.search-group {
  display: flex;
  height: 38px;
}

ul, ol {
  list-style: none;
}

.fw-bolder {
  padding-top: 24px;
  padding-left: 0;
}
import { useEffect, useState, memo, useMemo, useCallback } from "https://esm.sh/react";
import ReactDOM from "https://esm.sh/react-dom";

function App() {
  const [data, setData] = useState("I'm a data.");
  
  console.log(1);
  console.log('render data', data);
 
  useEffect(() => {
    // only render once
    console.log(3);
    console.log('useEffect data', data);
  }, []);
  
  setTimeout(() => {
    console.log(2);
    setData('I changed!');
  }, 0);

  return (
  <>
      <div>{data}</div>
  </>)
}

ReactDOM.render(<App />, document.querySelector("#app"));
View Compiled

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.2/css/bootstrap.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js