Open Rudy-Dev opened 2 years ago
I'm using 0.3.1 version of the transformer.
main.tsx
import Fusion from "@rbxts/fusion"; import Div from "./components/div"; const Main = (): Instance => { return ( <screengui> <Div> <textbox /> </Div> </screengui> ); }; export default Main;
div.tsx
import Fusion from "@rbxts/fusion"; import Corner from "./corner"; export default function Div(): Instance { return ( <frame> </frame> ); }
The error.
src/client/UI/Main.tsx:4:63 - error TS2554: Expected 0 arguments, but got 1. 4 return (Fusion.New("ScreenGui")({ [Fusion.Children]: [Div({ [Fusion.Children]: [Fusion.New("TextBox")({})] })] }));
Found an ugly way to go around the error.
function Div(props: { text: string } | { ____FusionChildren: Frame[] }): Instance { return ( <frame> </frame> ); }
I'm using 0.3.1 version of the transformer.
main.tsx
div.tsx
The error.