Skip to content

Commit 5587947

Browse files
committed
Try fixing some type errors
1 parent 2063190 commit 5587947

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/webamp/demo/js/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ async function main() {
159159
if (backgroundColor != null) {
160160
window.document.body.style.backgroundColor = backgroundColor;
161161
}
162-
const root = ReactDOM.createRoot(document.getElementById("demo-desktop"));
162+
const div = document.getElementById("demo-desktop");
163+
if (div == null) {
164+
throw new Error("Could not locate #demo-desktop div");
165+
}
166+
const root = ReactDOM.createRoot(div);
163167
root.render(
164168
<DemoDesktop webamp={webamp} soundCloudPlaylist={soundcloudPlaylist} />
165169
);

packages/webamp/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"strict": true,
1111
"jsx": "preserve",
1212
"noEmit": true,
13-
"pretty": true
13+
"pretty": true,
14+
"types": ["react/experimental", "react-dom/experimental"]
1415
},
1516
"include": ["**/*.ts", "**/*.tsx"],
1617
"exclude": ["node_modules", "demo/built"]

0 commit comments

Comments
 (0)