Try fixing some type errors

This commit is contained in:
Jordan Eldredge 2021-11-20 20:41:22 -08:00
parent 2063190dee
commit 5587947c7e
2 changed files with 7 additions and 2 deletions

View file

@ -159,7 +159,11 @@ async function main() {
if (backgroundColor != null) {
window.document.body.style.backgroundColor = backgroundColor;
}
const root = ReactDOM.createRoot(document.getElementById("demo-desktop"));
const div = document.getElementById("demo-desktop");
if (div == null) {
throw new Error("Could not locate #demo-desktop div");
}
const root = ReactDOM.createRoot(div);
root.render(
<DemoDesktop webamp={webamp} soundCloudPlaylist={soundcloudPlaylist} />
);

View file

@ -10,7 +10,8 @@
"strict": true,
"jsx": "preserve",
"noEmit": true,
"pretty": true
"pretty": true,
"types": ["react/experimental", "react-dom/experimental"]
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "demo/built"]