diff --git a/.gitignore b/.gitignore index 8485e98..df68c0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -ignore \ No newline at end of file +ignore +node_modules \ No newline at end of file diff --git a/globals.d.ts b/globals.d.ts new file mode 100644 index 0000000..5baf3c5 --- /dev/null +++ b/globals.d.ts @@ -0,0 +1,6 @@ +import { useState as useReactState, useEffect as useReactEffect } from "react"; + +declare global { + const useState: typeof useReactState; + const useEffect: typeof useReactEffect; +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..f74f4cc --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "bwe-demos", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/react": "^18.2.34" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..e01a2c5 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,28 @@ +lockfileVersion: '6.0' + +devDependencies: + '@types/react': + specifier: ^18.2.34 + version: 18.2.34 + +packages: + + /@types/prop-types@15.7.9: + resolution: {integrity: sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==} + dev: true + + /@types/react@18.2.34: + resolution: {integrity: sha512-U6eW/alrRk37FU/MS2RYMjx0Va2JGIVXELTODaTIYgvWGCV4Y4TfTUzG8DdmpDNIT0Xpj/R7GfyHOJJrDttcvg==} + dependencies: + '@types/prop-types': 15.7.9 + '@types/scheduler': 0.16.5 + csstype: 3.1.2 + dev: true + + /@types/scheduler@0.16.5: + resolution: {integrity: sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==} + dev: true + + /csstype@3.1.2: + resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} + dev: true diff --git a/src/LandingPage.jsx b/src/LandingPage.jsx index a4ded95..ab114b8 100644 --- a/src/LandingPage.jsx +++ b/src/LandingPage.jsx @@ -1,7 +1,8 @@ -State.init({ isDebug: true, showMonitor: true }); +const [isDebug, setIsDebug] = useState(true); +const [showMonitor, setShowMonitor] = useState(true); const buildUrl = (componentPath) => { - return `/${componentPath}?isDebug=${state.isDebug}&showMonitor=${state.showMonitor}`; + return `/${componentPath}?isDebug=${isDebug}&showMonitor=${showMonitor}`; }; return ( @@ -49,8 +50,8 @@ return ( type="checkbox" value="" id="flexCheckDefault" - checked={state.isDebug} - onChange={() => State.update({ isDebug: !state.isDebug })} + checked={isDebug} + onChange={() => setIsDebug(!isDebug)} />