File tree Expand file tree Collapse file tree 4 files changed +14
-6
lines changed
Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ You can download the latest release of froact as a rbxm file from https://github
77
88Froact can be added to your project via [ Wally] ( https://wally.run/ ) by adding this line under dependencies.
99``` toml
10- froact = " fewkz/froact@0.1.1 "
10+ froact = " fewkz/froact@0.1.3 "
1111```
1212
1313## How to use
Original file line number Diff line number Diff line change @@ -197,17 +197,21 @@ function froact.configure<Hooks>(config: {
197197 if config .defaultProperties then config .defaultProperties else {}
198198 )
199199 local function apply (props : any )
200+ local toRemove = {}
200201 for name , value in props do
201202 if typeof (name ) == " string" then
202203 if name :sub (1 , 2 ) == " on" then
203204 props [(config .Roact .Event :: any )[name :sub (3 )]] = value
204- props [name ] = nil
205+ toRemove [name ] = true
205206 elseif name :sub (1 , 4 ) == " bind" then
206207 props [(config .Roact .Change :: any )[name :sub (5 )]] = value
207- props [name ] = nil
208+ toRemove [name ] = true
208209 end
209210 end
210211 end
212+ for name , _ in toRemove do
213+ props [name ] = nil
214+ end
211215 if props .ref then
212216 props [config .Roact .Ref ] = props .ref
213217 props .ref = nil
Original file line number Diff line number Diff line change @@ -492,17 +492,21 @@ def count_references(klass):
492492body_lines .append (
493493 """\
494494\t local function apply(props: any)
495+ \t \t local toRemove = {}
495496\t \t for name, value in props do
496497\t \t \t if typeof(name) == "string" then
497498\t \t \t \t if name:sub(1, 2) == "on" then
498499\t \t \t \t \t props[(config.Roact.Event :: any)[name:sub(3)]] = value
499- \t \t \t \t \t props [name] = nil
500+ \t \t \t \t \t toRemove [name] = true
500501\t \t \t \t elseif name:sub(1, 4) == "bind" then
501502\t \t \t \t \t props[(config.Roact.Change :: any)[name:sub(5)]] = value
502- \t \t \t \t \t props [name] = nil
503+ \t \t \t \t \t toRemove [name] = true
503504\t \t \t \t end
504505\t \t \t end
505506\t \t end
507+ \t \t for name, _ in toRemove do
508+ \t \t \t props[name] = nil
509+ \t \t end
506510\t \t if props.ref then
507511\t \t \t props[config.Roact.Ref] = props.ref
508512\t \t \t props.ref = nil
Original file line number Diff line number Diff line change 11[package ]
22name = " fewkz/froact"
33description = " Wrapper around Roact & Roact Hooks to simplify UI development"
4- version = " 0.1.1 "
4+ version = " 0.1.3 "
55license = " MIT"
66registry = " https://github.com/UpliftGames/wally-index"
77realm = " shared"
You can’t perform that action at this time.
0 commit comments