summaryrefslogtreecommitdiff
path: root/frontend/src/router-hook.tsx
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2025-10-15 00:31:12 -0400
committerGitHub <noreply@github.com>2025-10-15 00:31:12 -0400
commit44bb023b804b0ab360214360a3947935fb41c86c (patch)
treef1313a32a16297fcaadecc3ba3eb2e21dec4ddb7 /frontend/src/router-hook.tsx
parent86b5567d4eac84399245c9a71270d6142ee54ded (diff)
downloaddecky-loader-44bb023b804b0ab360214360a3947935fb41c86c.tar.gz
decky-loader-44bb023b804b0ab360214360a3947935fb41c86c.zip
React 19 support (#818)v3.2.0-pre1v3.2.0
Diffstat (limited to 'frontend/src/router-hook.tsx')
-rw-r--r--frontend/src/router-hook.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/frontend/src/router-hook.tsx b/frontend/src/router-hook.tsx
index b3355d76..9b5f65dc 100644
--- a/frontend/src/router-hook.tsx
+++ b/frontend/src/router-hook.tsx
@@ -9,7 +9,7 @@ import {
getReactRoot,
sleep,
} from '@decky/ui';
-import { FC, ReactElement, ReactNode, cloneElement, createElement } from 'react';
+import { FC, JSX, ReactElement, ReactNode, cloneElement, createElement } from 'react';
import type { Route } from 'react-router';
import {
@@ -37,7 +37,7 @@ const isPatched = Symbol('is patched');
class RouterHook extends Logger {
private routerState: DeckyRouterState = new DeckyRouterState();
private globalComponentsState: DeckyGlobalComponentsState = new DeckyGlobalComponentsState();
- private renderedComponents: ReactElement[] = [];
+ private renderedComponents: ReactElement<any>[] = [];
private Route: any;
private DeckyGamepadRouterWrapper = this.gamepadRouterWrapper.bind(this);
private DeckyDesktopRouterWrapper = this.desktopRouterWrapper.bind(this);
@@ -233,7 +233,7 @@ class RouterHook extends Logger {
return <>{this.renderedComponents}</>;
}
- private gamepadRouterWrapper({ children }: { children: ReactElement }) {
+ private gamepadRouterWrapper({ children }: { children: ReactElement<any> }) {
// Used to store the new replicated routes we create to allow routes to be unpatched.
const { routes, routePatches } = useDeckyRouterState();
@@ -251,7 +251,7 @@ class RouterHook extends Logger {
return children;
}
- private desktopRouterWrapper({ children }: { children: ReactElement }) {
+ private desktopRouterWrapper({ children }: { children: ReactElement<any> }) {
// Used to store the new replicated routes we create to allow routes to be unpatched.
this.debug('desktop router wrapper render', children);
const { routes, routePatches } = useDeckyRouterState();
@@ -287,7 +287,7 @@ class RouterHook extends Logger {
if (routes) {
if (!routeList[routerIndex - 1]?.length || routeList[routerIndex - 1]?.length !== routes.size) {
if (routeList[routerIndex - 1]?.length && routeList[routerIndex - 1].length !== routes.size) routerIndex--;
- const newRouterArray: (ReactElement | JSX.Element)[] = [];
+ const newRouterArray: (ReactElement<any> | JSX.Element)[] = [];
routes.forEach(({ component, props }, path) => {
newRouterArray.push(
<Route path={path} {...props}>