<div id="root">
</div>
function App() {
React.useEffect(() => {
console.log('useEffect');
}, []);
return (
<div>
<h1>React StrictMode</h1>
<p>這是一個 StrictMode 的測試範例</p>
</div>
);
}
const root = ReactDOM.createRoot(document.querySelector('#root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
View Compiled
This Pen doesn't use any external CSS resources.