Skip to content

Commit

Permalink
Use non-null assertion instead of type assertion in createRoot()
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Aug 23, 2023
1 parent 1b91152 commit f95810d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sample/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { createRoot } from 'react-dom/client';

import Sample from './Sample.js';

createRoot(document.getElementById('react-root') as HTMLDivElement).render(<Sample />);
createRoot(document.getElementById('react-root')!).render(<Sample />);
2 changes: 1 addition & 1 deletion test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client';

import Test from './Test.js';

createRoot(document.getElementById('react-root') as HTMLDivElement).render(
createRoot(document.getElementById('react-root')!).render(
<StrictMode>
<Test />
</StrictMode>,
Expand Down

0 comments on commit f95810d

Please sign in to comment.