Skip to content

Commit

Permalink
test: remove non-null assertion in react-hooks sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
owenpearson committed Mar 14, 2024
1 parent b9bb651 commit 35b45a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/platform/react-hooks/sample-app/src/script.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import * as Ably from 'ably';
import App from './App.js';
import { AblyProvider } from '../../src/index.js';

const container = document.getElementById('root')!;
const rootId = 'root';
const container = document.getElementById(rootId);

if (!container) {
throw new Error(`No element found with id #${rootId} found`);
}

function generateRandomId() {
return Math.random().toString(36).substr(2, 9);
Expand Down

0 comments on commit 35b45a9

Please sign in to comment.