Skip to content

Commit

Permalink
removed New children parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
HappySunChild committed Feb 17, 2025
1 parent 2ef714c commit 62948a5
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/Instance/New.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ local package = script.Parent.Parent

local Types = require(package.Types)

local Children = require(package.Instance.Keys.Children)
local applyProperties = require(package.Instance.applyProperties)
local defaultProperties = require(package.Instance.defaultProperties)

local function New(
scope: Types.Scope,
classNameOrTemplate: string | Instance,
props: Types.Properties,
children: Types.Child
)
local function New(scope: Types.Scope, classNameOrTemplate: string | Instance)
local instance

if typeof(classNameOrTemplate) == 'Instance' then
Expand All @@ -36,16 +30,13 @@ local function New(
instance = newInstance
end

props = props or {}
return function(props: Types.Properties)
table.insert(scope, instance)

if children then
props[Children] = children
end

table.insert(scope, instance)
applyProperties(scope, instance, props)
applyProperties(scope, instance, props)

return instance
return instance
end
end

return New

0 comments on commit 62948a5

Please sign in to comment.