801 Commits

Author SHA1 Message Date
Mahmoud El-Gammal
ea656f7e75 feat: add onChange callback to useWindowSize 2024-12-02 17:02:44 +02:00
Mahmoud El-Gammal
3eb531ac9e feat: add onChange callback to useWindowSize 2024-12-02 16:51:00 +02:00
atiteux
75218e45df feat(pencil): add isFirst and isLast return value to 'useStateList' 2024-01-22 11:11:34 +01:00
Va Da
06afdf7b03
Merge pull request #2535 from suisous/pr/suisous
feat: Add clear() to useSet
2024-01-15 12:37:35 +01:00
Nam Nguyen
e7379f0887 fix: update useMedia hook to use recommended approach of MDN 2024-01-10 13:41:29 -04:00
suisous
5aa843666b Add clear() to useSet 2024-01-05 15:05:37 +09:00
Vadim Dalecky
3e042cb2f3
feat: add usePinchZoom sensor hook 2022-05-20 14:06:39 +02:00
Abhishek Mittal
af8d46e0c3 added usePinchZoom sensor hook 2022-05-04 14:06:49 +05:30
xg4
20b78178d0 fix: resolve @types/react@18 break change, React.FC 2022-04-08 16:09:22 +08:00
Teague Stockwell
5c01189412
fix: useMedia SSR hydration bug with defaultState (#2216)
* fix: useMedia SSR hydration bug with defaultState

Prevent a React hydration mismatch when a default value is provided
by not defaulting to window.matchMedia(query).matches.

* Refactor nested ifs
2021-12-30 15:31:24 +01:00
Lorenz Henk
01fb14d409
docs: fix typo in comment 2021-09-04 18:22:01 +02:00
streamich
51ef8d99ba perf: ️ change title only if it changed 2021-09-01 00:28:40 +02:00
Alexander Kachkaev
d2028ae44c
Run "yarn lint --fix" 2021-08-31 22:22:38 +01:00
Vadim Dalecky
fa3ba2520e
fix: do not re-render unncessarily in useAsyncFn hook 2021-08-31 21:16:44 +02:00
Vadim Dalecky
27f841de68
refactor: (useSpeech,usePermission) improved types 2021-08-31 21:15:54 +02:00
longwanxiang
3203610efd feat: useAudio add playing state 2021-08-27 18:28:04 +08:00
SkutinAnton
e5fb4e9601
Merge branch 'master' into fix-useAsyncFn 2021-08-25 11:22:38 +03:00
SkutinAnton
11144764c7 - fixed loading if we have initialState with loading: true 2021-08-25 11:06:59 +03:00
gelove
99208ffced refactor: (useSpeech,usePermission) improved types 2021-08-11 11:28:21 +08:00
Anton Zinovyev
5fd995eaf8
Merge pull request #1944 from adesurirey/pr/reset-useLocalStorage-state-on-key-change
fix(useLocalStorage): reinitialize on key change
2021-04-23 10:15:17 +03:00
xobotyi
66b0f23547
fix: lint issues. 2021-04-23 10:13:50 +03:00
Arnaud de Surirey
fdd1b23fd7 fix(useLocalStorage): reinitialize on key change 2021-04-14 15:27:11 +02:00
Anton Zinovyev
a91c1f169b
Merge pull request #1581 from arminyahya/pr/createHTMLMediaHook-typing
fix: add generic parameter to createHTMLMediaHook. no typecheck problem with ref anymore
2021-04-06 15:26:15 +03:00
Anton Zinovyev
d170deaa6d
Merge pull request #1792 from fnune/default-to-inner-width-create-breakpoint
Default to window.innerWidth instead of 0 in createBreakpoint
2021-04-06 15:25:56 +03:00
Fausto Núñez Alberro
14c9f411b6
Default to window.innerWidth instead of 0 in createBreakpoint 2021-04-06 14:21:32 +02:00
armin
1f547efb12 fix: add generic typing to createHTMLMediaHook. no typecheck problem with ref anymore. 2021-04-06 15:05:18 +04:30
armin
ac4dd786f4 fix: add generic typing to createHTMLMediaHook. no typecheck problem with ref anymore. 2021-04-06 13:49:17 +04:30
moonrailgun
923d2e7495 fix useKey type problem 2021-04-06 16:50:14 +08:00
xobotyi
5a5a5755bc
fix: lint issues. 2021-04-06 11:38:36 +03:00
Anton Zinovyev
93da25ca7a
Merge pull request #1577 from theruther4d/patch-1
fix: memory leak in useMeasureDirty
2021-04-06 11:33:38 +03:00
Anton Zinovyev
5bd35c19d1
Merge pull request #1485 from Acmu/patch-1
`setState` is unnecessary in deps
2021-04-06 11:26:36 +03:00
Anton Zinovyev
db66320fb8
Merge pull request #1684 from QingqiShi/patch-1
fix(useStateWithHistory): support callback style setState
2021-04-06 11:15:43 +03:00
xobotyi
3e8af15086
fix: lint issues. 2021-03-11 12:55:24 +03:00
Anton Zinovyev
110f072859
Merge pull request #1700 from eaglus/master
fix for useWindowScroll may lose window scroll change at mount #1699
2021-03-11 12:48:30 +03:00
robinvw1
e200f7fcbb fix: useMeasure type definitions for SVG 2021-03-11 10:18:04 +01:00
Victor Tiurin
6b708c880d fix for useWindowScroll may lose window scroll change at mount #1699
Update tests/useWindowScroll.test.tsx

Co-authored-by: Mathias <mathiassoeholm@gmail.com>

fix for useWindowScroll may lose window scroll change at mount #1699, fixes for review by mathiassoeholm

Update tests/useWindowScroll.test.tsx

Co-authored-by: Mathias <mathiassoeholm@gmail.com>
2021-03-11 10:50:54 +02:00
Anton Zinovyev
e3adac01af
Merge branch 'master' into patch-3 2021-03-10 18:38:01 +03:00
Edwin Joseph
793b0539f0 fix(useOrientation): handle orientation being 0 2021-03-09 23:07:29 +09:00
kodai3
2f33aa8182 fix: use window inside useEffect 2021-03-09 23:00:21 +09:00
Juan Lulkin
d9e2e5e2db Merge new types from resolveHookState 2021-02-16 09:49:49 +01:00
Juan Lulkin
b7f1939097 Uses resolveHookState and its types 2021-02-16 09:45:03 +01:00
Juan Lulkin
0713ed68c6 feat:Makes createGlobalState API compatible with React 2021-02-15 20:57:05 +01:00
Anton Zinovyev
1c18e28226
Merge pull request #1511 from WhiteMinds/fix_use_mounted_state
fix: useMountedState should not change state on componentDidUpdate lifecycle
2021-02-10 22:39:48 +03:00
xobotyi
b6993a6f95
feat(prettier): make prettier a part of eslint.
Also reduce max line width to 100. And remove `lint:types` step for
commit sequence, it bothers when committing incomplete (wip) changes.
2021-02-01 18:58:55 +03:00
Anton Zinovyev
30d8b413c8
Merge pull request #1780 from meowtec/fix-useMeasure-type
fix: proper definition for `useMeasure`
2021-02-01 14:09:49 +03:00
meowtec
1461527ffc fix: proper definition for useMeasure 2021-01-31 17:51:07 +08:00
xobotyi
0636cd87f4
chore(useUpdate): improve useUpdate test suite 2021-01-31 11:28:36 +03:00
xobotyi
a087deb48e
fix: proper definition for isBrowser and isNavigator states.
should fix: #1777

Also introduce jest config for ssr tests (it fails hard now).
2021-01-31 10:33:48 +03:00
xobotyi
23037f207d
feat: refactor the useNetwork hook.
Improved hook performance, now works with safari.

BREAKING CHANGE: `useNetwork` hook renamed to `useNetworkState`.
2021-01-31 03:14:20 +03:00
xobotyi
723c588fef
feat: improve on and off util functions typing. 2021-01-31 03:03:51 +03:00