function Jovan.New(className : string) : (props : any) -> GuiObject
return function(props : any) : GuiObject
local newUI = Instance.new(className)
local cssProps = {}
for name, val in pairs(props) do
if markers[name] then continue end
newUI[name] = val
end
if props[CHILDREN_MARKER] then
for _, element in ipairs(props[CHILDREN_MARKER]) do
element.Parent = newUI
end
end
if props[DECLARATION_MARKER] then
for name, val in pairs(cssProps) do
Properties[name](newUI, val)
end
end
return newUI
end
end
local New = Jovan.New
local root = New "ScreenGui" {
Parent = workspace,
[Jovan.Children] = {
New "TextLabel" {
Text = "Works",
Size = UDim2.fromOffset(100, 200),
},
},
[Jovan.Declarations] = {
centered = true,
},
}
Could anyone tell me why the [Jovan.Declarations] and [Jovan.Children] are expected to be the same type? I’ve tried changing the function definition’s types but that wont do anything
I’ve been reading through the documentation on strict type checking recently, but it doesn’t say anything about performance. Does strict typing improve performance or is this just preference?
It seems as if Declarations always needs a boolean value.
This might be an issue, if this is a Fusion feature, you should create an issue about it / comment on the PR on making Fusion strictly typed on GitHub.
This isnt the real fusion, just a copy i put the code at the start of the post, and declarations shouldn’t need a bool value, but the linter thinks the tables should be the same type which is what im trying to fix/silence