Releases: sheinsight/react-use
Releases · sheinsight/react-use
v1.5.0
🚀 Features
-
Add new Hook
useQuery
renamed fromuseRequest
- by @vikiboss (11f65) -
Add internal Hooks
useTrackedRefState
&useVersionedAction
- by @vikiboss (783fa) -
Add new Hook
useFirstRender
to check whether it's the first render. - by @vikiboss (aee59) -
useAsyncFn:
-
useClipboard:
-
useClipboardItems:
-
useLatest:
-
useLoadingSlowFn:
-
usePagination:
-
usePerformanceObserver:
-
usePrevious:
-
useQuery:
-
useRequest:
-
useWebObserver:
🐞 Bug Fixes
View changes on GitHub
v1.4.0
Add useRequest
Hook
useRequest
is a common hook for data fetching, supports cache, automatic refresh, and many awesome features.
- Support basic async operations state management (loading, data, error, params, etc.)
- Support many lifecycle hooks, such as onBefore, onSuccess, onError, etc.
- Support continuous automatic refresh, manual refresh, and refresh control
- Support automatic refresh when the network is reconnected, the page is focused, etc.
- Support cross-platform visibility and online judgment to control automatic refresh
- Support error retry, error retry interval, and error retry count
- Support throttle and debounce for manual refresh
- Support custom loading timeout, loading slow detection, and loading slow timeout
- Support cache, cache expiration time, and cache provider (SWR)
- Support clear cache, get cache, and mutate cache globally or locally
- Support pausable to control internal automatic behavior
- Support manual refresh, automatic refresh, and manual control refresh
🚀 Features
- New Hook
useInputComposition
to track composition state ofinput
element - by @vikiboss (5be4b) - New Hook
useLoadingSlowFn
to track loading slow state - by @vikiboss (732fa) - New Hook
useReConnect
to run a callback when re-connect - by @vikiboss (772ab) - New Hook
useReFocus
to run a callback when re-focus - by @vikiboss (88cc9) - New Hook
useRetryFn
to create a function with retry mechanism - by @vikiboss (2eceb) - createSingleLoading:
- useAsyncFn:
- Support
onMutate
,onCancel
,onRefresh
callbacks - by @vikiboss (a1298) - Support
onError
callback - by @vikiboss (072f0) - Support lifecycle callbacks & improve render performance - by @vikiboss (fe1b8)
mutate
&refresh
support params - by @vikiboss (02ff0)- Support
compare
options to control render behavior - by @vikiboss (dfed2)
- Support
- useReactive:
🐞 Bug Fixes
- useAsyncFn: Fix race condition bug - by @vikiboss (9071e)
- useResetState: Fix returned
initialValue
- by @vikiboss (5e128) - useToggle: Fix hook returned value - by @vikiboss (dd976)
🏎 Performance
View changes on GitHub
v1.3.0
v1.2.1
v1.2.0
🚀 Features
🐞 Bug Fixes
- useActiveElement: Use
useLayoutMount
to prevent layout jitter - by @vikiboss (f8e25) - useBreakpoints: Use
useDeepCompareLayoutEffect
to prevent layout jitter - by @vikiboss (5a588) - useCssVar: Use
useLayoutMount
to prevent layout jitter - by @vikiboss (7935a) - useFavicon: Use
useLayoutMount
to prevent layout jitter - by @vikiboss (d0c82) - useFocus: Use
useLayoutMount
to prevent layout jitter - by @vikiboss (f2950) - useMediaQuery: Use
useDeepCompareLayoutEffect
to prevent layout jitter - by @vikiboss (11f16) - useNetwork: Use
useIsomorphicLayoutEffect
to prevent layout jitter - by @vikiboss (04255) - useSupported: Use
useIsomorphicLayoutEffect
to prevent layout jitter - by @vikiboss (b5378) - useTextDirection: Use
useLayoutMount
to prevent layout jitter - by @vikiboss (fc474) - useUrlSearchParams: Use
useLayoutMount
to prevent layout jitter - by @vikiboss (584d1) - useWindowFocus: Use
useLayoutMount
to prevent layout jitter - by @vikiboss (273e9) - useWindowScroll: Use
useLayoutMount
to prevent layout jitter - by @vikiboss (d136b) - useWindowSize: Use
useLayoutMount
to prevent layout jitter - by @vikiboss (c1d0b)
View changes on GitHub
v1.1.4
🐞 Bug Fixes
View changes on GitHub
v1.1.3
🐞 Bug Fixes
- useInfiniteScroll: Fix
onScroll
event not being triggered when target scroll - by @vikiboss (73a9c) - useParallax: Remove unused options. - by @vikiboss (10f6b)
- useTargetElement: Advance the reffable value resolve time in target element - by @vikiboss (e3766)
- useTitle: Correct unify type name - by @vikiboss (19338)
View changes on GitHub
v1.1.2
🐞 Bug Fixes
- createSingleLoading, useReactive: Use
create
option to avoid import and ESM require error - by @vikiboss (2b854)
View changes on GitHub
v1.1.1
🐞 Bug Fixes
- useReactive, createSingleLoading: Use require to dynamic import to avoid no dep error - by @vikiboss (fc9d1)