@@ -46,9 +46,7 @@ local function newTemplate(roact: any, unpureByDefault: boolean?)
4646 onUpdate : (UpdateMethod <Props> ) -> ()
4747 ) -> CleanupMethod
4848 return function <Props >(config : ComponentConfig , f : Constructor<Props> )
49- local isPure = if config .pure == nil
50- then not unpureByDefault
51- else config .pure
49+ local isPure = if config .pure == nil then not unpureByDefault else config .pure
5250 local Component = if isPure
5351 then roact .PureComponent :extend (config .name or " Component" )
5452 else roact .Component :extend (config .name or " Component" )
@@ -103,9 +101,7 @@ local function newList(roact: any)
103101 local index = if config .initial then config .initial else 0
104102 local count : { [string ]: number } = {}
105103 local dict = {}
106- local nameFormat = " %0"
107- .. math.floor (math.log10 (# elements ) + 1 )
108- .. " i | %s" -- For orderByName
104+ local nameFormat = " %0" .. math.floor (math.log10 (# elements ) + 1 ) .. " i | %s" -- For orderByName
109105 for _ , element in elements do
110106 local isRobloxClass = typeof (element .component ) == " string"
111107 local className = if isRobloxClass
@@ -114,8 +110,7 @@ local function newList(roact: any)
114110
115111 local sortType = if not isRobloxClass
116112 then " Component"
117- else if isRobloxClass
118- and isA (element .component , " GuiObject" )
113+ else if isRobloxClass and isA (element .component , " GuiObject" )
119114 then " Instance"
120115 else " None"
121116
@@ -152,23 +147,14 @@ end
152147
153148local blankChildren = table .freeze ({})
154149
155- type HookFunction < Props , Hooks > = (
156- render : (Props , Hooks ) -> any ,
157- options : any
158- ) -> any
150+ type HookFunction < Props , Hooks > = (render : (Props , Hooks ) -> any , options : any ) -> any
159151
160- local function newC <Hooks >(
161- roact : any ,
162- hooks : HookFunction<any , Hooks >,
163- unpureByDefault : boolean ?
164- )
152+ local function newC <Hooks >(roact : any , hooks : HookFunction<any , Hooks >, unpureByDefault : boolean ? )
165153 return function <Props >(
166154 config : ComponentConfig ,
167155 body : (Props , Hooks , { Element }) -> any
168156 ): (Props , Children ) -> any
169- local isPure = if config .pure == nil
170- then not unpureByDefault
171- else config .pure
157+ local isPure = if config .pure == nil then not unpureByDefault else config .pure
172158 -- Wrap the body to have children passed in as a third argument
173159 local function wrappedBody (props : any , hooks )
174160 local children = props [roact .Children ]
0 commit comments