<div id="app"></div>
const App = () => {
const handler = (event) => {
event.preventDefault()
window.alert('Click!');
}
return (
<div>
<a href="https://israynotarray.com/" onClick={ handler }>點我</a>
</div>
)
}
const app = document.querySelector('#app');
const root = ReactDOM.createRoot(app);
root.render(<App />);
View Compiled
This Pen doesn't use any external CSS resources.