Fix
Some checks failed
Lint / lint (push) Failing after 9s

This commit is contained in:
Julien Valverdé
2026-01-02 23:08:27 +01:00
parent d02864b873
commit ff2d92d743
3 changed files with 19 additions and 7 deletions

View File

@@ -1,11 +1,6 @@
import { Control } from "godot"
import { Renderer } from "react-godot-renderer"
import { Class } from "react-godot-renderer"
import { TestUi1Component } from "./TestUi1Component"
export default class TestUi1 extends Control {
// Called when the node enters the scene tree for the first time.
_ready(): void {
Renderer.renderComponent(this, TestUi1Component)
}
}
export default class TestUi1 extends Class.make(Control, TestUi1Component) {}

View File

@@ -0,0 +1,16 @@
/** biome-ignore-all lint/complexity/noBannedTypes: {} is the "empty props" type in React */
import type * as Godot from "godot"
import type * as React from "react"
import * as Renderer from "./Renderer.js"
export const make = <C extends new (...args: any[]) => Godot.Node<Godot.NodePathMap>>(
parent: C,
component: React.FC<{}>,
): C => class extends parent {
_ready(): void {
// @ts-expect-error
if (super._ready) super._ready()
Renderer.renderComponent(this, component)
}
}

View File

@@ -1,3 +1,4 @@
export * as Class from "./Class.js"
export * as Component from "./Component.js"
export * as JSX from "./JSX.js"
export * as Reconciler from "./Reconciler.js"