Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(document.getElementById('root'));
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"as" 키워드로 type assertion 하셨군요. 👍

type assertion을 사용하면, 타입추론을 덮어쓸 수 있으니, 타입에러는 피할 수 있지만, 런타임에, 즉 동작중에는 충분히 다른값이 들어갈 수 있습니다. 주의해주세요

);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
</React.StrictMode>,
);

// If you want to start measuring performance in your app, pass a function
Expand Down