mirror of
https://github.com/littensy/charm.git
synced 2026-10-20 17:51:37 +00:00
fix: wrap hooks in untracked, update types
This commit is contained in:
parent
1657e2cb74
commit
87e7260c16
5 changed files with 40 additions and 16 deletions
|
|
@ -16,7 +16,7 @@ local function useAtom<T>(getter: () -> T, dependencies: { any }?): T
|
|||
|
||||
React.useLayoutEffect(function()
|
||||
return Charm.effect(function()
|
||||
setState(getter())
|
||||
Charm.untracked(setState, getter())
|
||||
end)
|
||||
end, dependencies or {})
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ local function useAtomBinding<T>(getter: () -> T, dependencies: { any }?)
|
|||
|
||||
React.useLayoutEffect(function()
|
||||
return Charm.effect(function()
|
||||
setBinding(getter())
|
||||
Charm.untracked(setBinding, getter())
|
||||
end)
|
||||
end, dependencies or {})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue