Chap03n -> Understanding and enabling strict mode

Chap02
Jason Zhu 2022-03-23 09:55:03 +11:00
parent 5166958107
commit 157120eb64
2 changed files with 14 additions and 1 deletions

View File

@ -6,6 +6,7 @@ function App() {
return ( return (
<div className="App"> <div className="App">
<header className="App-header"> <header className="App-header">
<ProblemComponent />
<img src={logo} className="App-logo" alt="logo" /> <img src={logo} className="App-logo" alt="logo" />
<p> <p>
Edit <code>src/App.tsx</code> and save to reload. Edit <code>src/App.tsx</code> and save to reload.
@ -23,4 +24,10 @@ function App() {
); );
} }
class ProblemComponent extends React.Component {
render() {
return <div ref="div" />;
}
}
export default App; export default App;

View File

@ -8,10 +8,16 @@ ReactDOM.render(
<React.StrictMode> <React.StrictMode>
<App /> <App />
</React.StrictMode>, </React.StrictMode>,
document.getElementById('root') document.getElementById('root'),
); );
// If you want to start measuring performance in your app, pass a function // If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log)) // to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals(); reportWebVitals();
class ProblemComponent extends React.Component {
render() {
return <div ref="div" />;
}
}