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
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
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
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
streamich
ffc75790e3
fix: 🐛 dont memoize useScratch event handlers
2020-05-18 01:04:41 +02:00
streamich
87fbe1534c
chore: 🤖 add latest useMeasure hook changes ( #1213 )
2020-05-16 15:03:42 +02:00
streamich
e1dbd39f18
chore: 🤖 catch up with master
2020-05-16 14:59:21 +02:00
streamich
21e53ffc0f
Merge branch 'master' into improve-useMeasure
2020-05-16 14:55:42 +02:00
streamich
9ae494fc18
fix: 🐛 correctly test if env is browser in useMeasure
2020-05-16 14:53:56 +02:00
streamich
dc92b646d0
fix: 🐛 revert useMeasure defaults to zeros
2020-05-16 14:53:10 +02:00
streamich
2a13fbae45
feat: 🎸 remove resize-observer-polyfill from useMeasure
...
BREAKING CHANGE: resize-observer-polyfill package is not used with useMeasure() hook
anymore.
2020-05-16 14:46:41 +02:00
streamich
866f3d740b
feat: 🎸 mock useMeasure() hook on server and w/o ResizeObserver
2020-05-16 14:39:37 +02:00
streamich
a164843902
feat: 🎸 improve implementation of useMeasure() hook
...
BREAKING CHANGE: useMeasure() now defaults all values to -1, if they were not set and
internal implementation heavily refactored.
2020-05-16 14:39:20 +02:00
streamich
5f5dd09bf3
test: 💍 add useScratch() stories
2020-05-16 14:27:33 +02:00
streamich
2a2a298b73
feat: 🎸 add useScratch hook
2020-05-16 14:26:51 +02:00
Clément Paris
5488f5eb3e
fix: mutate ref in render directly
2020-05-13 19:06:45 +02:00
Clément Paris
d6fe267615
feat: add useLatest hook
2020-05-10 18:09:30 +02:00
streamich
138b43cd1a
feat: 🎸 onScrubStop provide value where scrub stopped
2020-04-24 18:36:32 +02:00
manishsundriyal
1ead4efab6
fix: doesn't unlock the body on unmount
2020-04-13 17:46:58 +05:30
Marco Antonio Ghiani
cc57c2aed9
refactor: moved out reducer to improve memory usage
2020-04-08 09:51:22 +03:00
Marco Antonio Ghiani
893153141a
refactor(useToggle): useReducer optimization, use a single hook
2020-04-08 09:51:22 +03:00
whincwu
44a6cde00e
feat: add useHash hook
2020-04-08 09:21:06 +03:00
Anton Zinovyev
ee5a5659fb
Merge pull request #1096 from streamich/implement-1090
...
feat(useRafLoop): rework the hook
2020-04-04 11:58:34 +03:00
Steven Lundy
46e01e09dc
Fix error message typo
2020-04-01 14:11:28 -07:00
xobotyi
baa2f7511e
feat(useRafLoop): reworked the hook, now it do not re-render parent component.
...
BREAKING CHANGE: changed return array, now it returns only functions in next order: [stop, start, isActive].
Parent component is not re-rendered on loop start/stop.
2020-04-01 10:43:31 +03:00
xobotyi
1ef1272d6d
feat(useRafLoop): implement #1090
2020-04-01 08:49:05 +03:00
Sebastiaan ten Pas
ad29bea7b0
fix: replace createFactory usages with createElement
2020-03-17 16:10:14 +00:00