Skip to content

Releases: sheinsight/react-use

v1.5.0

21 Aug 02:42
Compare
Choose a tag to compare

   🚀 Features

  • Add new Hook useQuery renamed from useRequest  -  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:

    • Rewrite to use auto-tracked state to improve performance  -  by @vikiboss (3ec25)
  • useClipboard:

  • useClipboardItems:

  • useLatest:

  • useLoadingSlowFn:

    • Rewrite to use auto-tracked state to improve performance  -  by @vikiboss (97226)
  • usePagination:

    • Support return sliced list directly (pass list in options), add indexStart, indexEnd in returns  -  by @vikiboss (2ed32)
  • usePerformanceObserver:

  • usePrevious:

  • useQuery:

  • useRequest:

    • Deprecated useRequest, please use useQuery instead.  -  by @vikiboss (26c51)
  • useWebObserver:

    • Support additional supported check for specific observer  -  by @vikiboss (d30a9)

   🐞 Bug Fixes

    View changes on GitHub

v1.4.0

09 Aug 02:20
Compare
Choose a tag to compare

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 of input 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:
    • Deprecated, it will be removed in the future, maybe moved to @shined/reactive  -  by @vikiboss (8b479)
  • useAsyncFn:
  • useReactive:
    • Deprecated, it will be removed in the future, maybe moved to @shined/reactive  -  by @vikiboss (03ac5)

   🐞 Bug Fixes

   🏎 Performance

  • useLoadingSlowFn: Using getter to refine performance  -  by @vikiboss (31a59)
    View changes on GitHub

v1.3.0

15 Jul 06:33
Compare
Choose a tag to compare

   🚀 Features

    View changes on GitHub

v1.2.1

10 Jul 02:35
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v1.2.0

10 Jul 01:38
Compare
Choose a tag to compare

   🚀 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

09 Jul 07:51
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v1.1.3

03 Jul 09:47
Compare
Choose a tag to compare

   🐞 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

02 Jul 06:45
Compare
Choose a tag to compare

   🐞 Bug Fixes

  • createSingleLoading, useReactive: Use create option to avoid import and ESM require error  -  by @vikiboss (2b854)
    View changes on GitHub

v1.1.1

02 Jul 02:43
Compare
Choose a tag to compare

   🐞 Bug Fixes

  • useReactive, createSingleLoading: Use require to dynamic import to avoid no dep error  -  by @vikiboss (fc9d1)
    View changes on GitHub

v1.1.0

02 Jul 02:31
Compare
Choose a tag to compare

   🚀 Features

  • useDynamicList: Add setList method in return actions  -  by @vikiboss (0eff4)

   🐞 Bug Fixes

  • useEventListener: Should re-add-and-remove event when ref.current changed  -  by @vikiboss (6ffdc)
  • useUrlSearchParams: Fix type import  -  by @vikiboss (2fc03)
    View changes on GitHub