This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
[0.3.0]
Changed
useEffect
now call its unmount function when its dependencies change, just like React hooks.useState
will now cache default values, meaninguseState(math.random)
will no longer give a new default value every time.useState
with a default parameter will now call the function without parameters, rather than with 1 nil parameter. This caused problems withuseState(math.random)
, asmath.random()
is valid, butmath.random(nil)
is not.
Fixed
useState
will now properly pass in default values when giving a callback to the set function, rather than passing in nil.