<div id="root">
    <!-- This element's contents will be replaced with your component. -->
</div>
const {useEffect, useState} = React;

function App() {
  const [tableData, setTableData] = useState(null);

  useEffect(() => {
    async function getTableData() {
      try {
        await fetch('https://jsonplaceholder.typicode.com/posts/1')
          .then((res) => { return res.json() })
          .then((data) => { 
             //console.log(data)
            setTableData(data) 
          })
      }
      catch (err) {
        console.error(err);
      }
    }
    getTableData();
  }, []);

  return (
    <div className="wrapper">
        tableData: { tableData && 'ok' }
    </div>
  );
}



  ReactDOM.render(
    <App/>,
    document.getElementById('root')
  );

View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://unpkg.com/react/umd/react.development.js
  2. https://unpkg.com/react-dom/umd/react-dom.development.js