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
Renovate Bot
a27f09fd36
chore: refactoring and rearrangement.
...
More DRY code. Also move non-hooks to separate directories.
BREAKING CHANGE: all `create*` factories been moved to `factory` subdirectory and in case direct import should be imported like `react-use/esm/factory/createBreakpoint`
BREAKING CHANGE: `comps` directory renamed to `component`
2021-01-30 23:30:26 +03:00
CRIMX
9ff5c09e67
fix: useUnmountPromise stops on immediate update
2021-01-29 19:56:20 +08:00
xobotyi
acff81d99a
fix: improve useStateValidator and useMultiStateValidator typings.
...
Now it is compatible with TS 4.x.x
2021-01-08 22:26:27 +03:00
xobotyi
ebc7094bbc
fix : #1646
...
make own interface that compatible with GeolocationPositionError and PositionError.
It is the easiest way to avoid errors in typescript 4.1
2021-01-08 21:45:35 +03:00
Qingqi Shi
fca687d32c
fix(useStateWithHistory): support callback style setState
...
Make `useStateWithHistory` support the callback style set state, e.g. `setState(current => current + 1)`.
2020-12-06 14:40:07 +00:00
Josh Rutherford
7613749c97
Fix memory leak in useMeasureDirty
2020-10-16 13:14:25 -05:00
WhiteMinds
701b306ed9
fix: useMountedState should not change state on componentDidUpdate lifecycle
2020-09-16 10:47:33 +08:00
Anton Zinovyev
9f3cc3d33a
fix: useLongPress hook linting fixes.
2020-09-05 00:12:20 +03:00
Anton Zinovyev
22211d9720
Merge pull request #1337 from ddaza/master
...
chore: Removed eslint comments, added global formatting, fixed errors
2020-09-04 23:34:36 +03:00
MinYuan
f0d05c665a
setState is unnecessary in deps
2020-09-02 07:42:36 +08:00
Anton Zinovyev
120179d251
Merge pull request #1049 from Tirzono/pr/replace-createfactory
...
fix: replace createFactory usages with createElement
2020-07-24 10:13:35 +03:00
ddaza
228ce59df3
fixed tests
2020-07-02 16:29:03 -05:00
ddaza
db07ab65bf
updated formating and fixed errors
2020-07-02 14:56:15 -05:00
ddaza
3ce080cdf3
updated prettier and eslint
2020-07-02 14:19:03 -05:00
xobotyi
e6e55a3f94
fix(useFullscreen): fix typings so #1205 can be merged.
2020-06-29 23:44:22 +03:00
xobotyi
a4279eb660
fix(usePrevious): revert the reworked variant as a fix of #1315
...
fix:#1315
2020-06-29 22:57:30 +03:00
xobotyi
8c6f4675be
feat(usePrevious): reworked the hook, now it is more memory-efficient.
...
Better to use two-variables exchange than `useEffect` with new
function on each render.
2020-06-15 14:37:37 +03:00
Vadim Dalecky
f312b06bbe
Merge pull request #1130 from manishsundriyal/pr/useLockBodyScroll-858
2020-06-13 14:42:17 +02:00
streamich
b2f46d10f2
fix: 🐛 improve how text is dropped in useDrop hook
2020-06-13 13:42:36 +02:00
Robert Hurst
8410bb042f
fix: repair useKeyboardJs hook
...
Fixed the importing of the KeyboardJS library with backward compatibility. Updated how bindings are set to prevent KeyboardJS from calling handlers repeatedly while holding keys.
2020-06-08 10:57:51 -07:00
streamich
f3c715c124
fix: 🐛 bump fast-deep-equal, and consume it through ES import
2020-06-08 11:10:03 +02:00
tkwant
d714b12e8b
feat: add useMouseWheel hook
2020-06-05 22:50:34 +02:00
streamich
dad26e507d
fix: 🐛 use useIsomorphicLayoutEffect everywhere
2020-05-30 17:41:20 +02:00
streamich
e33cf9f87b
chore: 🤖 catch up with master
2020-05-18 16:03:20 +02:00
Torleif Berger
bedbad7231
fix: 🐛 correct useMeasure typings
...
When upgrading to v15, I discovered some issues with `useMeasure` forcing me to downgrade to v14 again. Hopefully these changes fixes those issues...
* It was no longer possible to define the ref type, meaning components requiring a certain type of ref would reject it. Fixed this by making the function generic again.
* Previously you _had to_ define the ref type, while in v15 you _couldn't_. Fixed this by giving the generic type a default type of `HTMLElement`.
* The implicit typing of `useMeasureMock` combined with the ternary default export statement made the imported type of `useMeasure` very messy. Fixed this by making the type of `useMeasureMock` explicitly match `useMeasure`.
2020-05-18 14:35:40 +02:00