diff options
| -rw-r--r-- | src/index.tsx | 7 | ||||
| -rw-r--r-- | tsconfig.json | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/index.tsx b/src/index.tsx index bd17cff..2c40a21 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -9,7 +9,6 @@ import { showModal, staticClasses, } from "decky-frontend-lib"; -import * as React from "react"; // JSX needs this, since React < 17.0.0 doesn't support the JSX runtime. import { VFC } from "react"; import { FaShip } from "react-icons/fa"; @@ -67,8 +66,8 @@ const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => { export default definePlugin((serverApi: ServerAPI) => { return { - title: <div className={staticClasses.Title}>Example Plugin</div>, - content: <Content serverAPI={serverApi} />, - icon: <FaShip />, + title: () => <div className={staticClasses.Title}>Example Plugin</div>, + content: () => <Content serverAPI={serverApi} />, + icon: () => <FaShip />, }; }); diff --git a/tsconfig.json b/tsconfig.json index d4de0f6..13b0c35 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "module": "ESNext", "target": "ES2020", "jsx": "react", + "jsxFactory": "window.SP_REACT.createElement", "declaration": false, "moduleResolution": "node", "noUnusedLocals": true, |
