From 945ef34829f46c26428e5b3f4a897ad1b5b71cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sun, 28 Dec 2025 23:53:22 +0100 Subject: [PATCH] Fix JSX types --- packages/react-godot-renderer/src/jsx.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/react-godot-renderer/src/jsx.ts b/packages/react-godot-renderer/src/jsx.ts index 6653202..6a0471b 100644 --- a/packages/react-godot-renderer/src/jsx.ts +++ b/packages/react-godot-renderer/src/jsx.ts @@ -1,4 +1,5 @@ import type * as Godot from "godot" +import type { CamelCase } from "type-fest" type NodeClass = { @@ -7,25 +8,23 @@ type NodeClass = { : never }[keyof typeof Godot] -type DecapitalizeString = S extends `${infer F}${infer R}` ? `${Lowercase}${R}` : S - type PropsFromInstance = { // biome-ignore lint/complexity/noBannedTypes: it's completely fine [K in keyof T as T[K] extends Function ? never : K]?: T[K] } type GodotIntrinsicElements = { - [K in NodeClass as DecapitalizeString]: PropsFromInstance> + [K in NodeClass as CamelCase]: PropsFromInstance> } & { custom: { class: new (...args: any[]) => Godot.Node } } -// declare global { - declare namespace React { +declare global { + namespace React { namespace JSX { interface IntrinsicElements extends GodotIntrinsicElements {} } } -// } +}