Get your own React server
main.jsx
index.html
 
import React from 'react';
import ReactDOM from 'react-dom/client';

function shoot() {
  alert("Great Shot!");
}

const myelement = (
  <button onClick={shoot}>Take the shot!</button>
);

const container = document.getElementById('root');
const root = ReactDOM.createRoot(container);
root.render(myelement);

                    
<!doctype html>
<html lang="en">
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.jsx"></script>
  </body>
</html>

                    
localhost:5173