mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
Merge pull request #809 from streamich/fix-useSet-stale-closure
fix: use latest set object in useSet "has" method
This commit is contained in:
commit
52fbbfd7a6
@ -19,7 +19,7 @@ const useSet = <K>(initialSet = new Set<K>()): [Set<K>, Actions<K>] => {
|
||||
remove: item => setSet(prevSet => new Set(Array.from(prevSet).filter(i => i !== item))),
|
||||
reset: () => setSet(initialSet),
|
||||
}),
|
||||
[setSet]
|
||||
[set, setSet]
|
||||
);
|
||||
|
||||
const utils = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user