Skip to content

Commit 4bf77b7

Browse files
committed
Use non-null assertion instead of type assertion in createRoot()
1 parent c0ed92c commit 4bf77b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sample/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import { createRoot } from 'react-dom/client';
33

44
import Sample from './Sample.js';
55

6-
createRoot(document.getElementById('react-root') as HTMLDivElement).render(<Sample />);
6+
createRoot(document.getElementById('react-root')!).render(<Sample />);

test/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client';
33

44
import Test from './Test.js';
55

6-
createRoot(document.getElementById('react-root') as HTMLDivElement).render(
6+
createRoot(document.getElementById('react-root')!).render(
77
<StrictMode>
88
<Test />
99
</StrictMode>,

0 commit comments

Comments
 (0)