Skip to content

Releases: childrentime/reactuse

v6.3.1

01 Apr 03:57

Choose a tag to compare

Bug Fixes

  • useClipboard: fix SSR safety issue — replace direct window reference with defaultWindow in focus event listener to prevent ReferenceError in server-side rendering environments

v6.3.0

24 Mar 15:26

Choose a tag to compare

What's Changed

Refactor

  • createStorage: Replace useState + useDeepCompareEffect with useSyncExternalStore, eliminating CSR first-render flicker, SSR hydration mismatches, and stale cross-tab reads (#195)

Bug Fixes

  • createStorage: Fix stale closure in consecutive functional updates within the same synchronous batch — updateState now reads from getSnapshot() instead of the render-time state

Tests

  • useLocalStorage: Add 12 new test cases covering cross-tab sync, storage.clear(), listenToStorageChanges toggle, three-state semantics, onError, mountStorageValue, and consecutive functional updates

Full Changelog: v6.1.12...v6.3.0

v6.1.12

10 Mar 08:42

Choose a tag to compare

  • fix(useGeolocation): make useSupported check more robust

6.1.2(Oct 30, 2025)

30 Oct 06:13

Choose a tag to compare

  • feat: add useScratch hook.

6.1.0(Sep 24, 2025)

24 Sep 09:33

Choose a tag to compare

Breaking Changes

  • useDarkMode: Storage format changed from boolean to string values ('dark'/'light'). This affects localStorage/sessionStorage data and SSR scripts. Existing stored boolean values will be automatically migrated, but custom SSR scripts need to be updated to handle string comparisons instead of boolean values.

Core

  • feat: add useMap hook for reactive Map state management with set, get, remove, has, clear, and reset operations
  • feat: add useColorMode hook with support for multiple color modes beyond dark/light
  • feat: add useBoolean hook for boolean state management with setValue, setTrue, setFalse, and toggle operations
  • feat: add useClickAway alias for useClickOutside hook
  • feat: add useCopyToClipboard alias for useClipboard hook
  • feat: add comprehensive documentation for useColorMode hook
  • docs: add context provider examples for both useColorMode and useDarkMode
  • docs: add multi-color theme examples in useColorMode documentation (6 themes: light, dark, blue, green, purple, sepia)
  • docs: update useDarkMode documentation scripts to handle new string storage format

MCP Support

07 Jul 08:05

Choose a tag to compare

If you want to use the MCP (Meta Command Protocol) integration with reactuse, you can easily set it up with the following configuration. This allows you to run the @reactuses/mcp utility via npx for enhanced command-line support and automation.

Add the following to your configuration:

"@reactuses/mcp": {
  "command": "npx",
  "args": ["-y", "@reactuses/mcp@latest"],
  "type": "stdio"
}

6.0.2(May 06, 2025)

06 May 08:15

Choose a tag to compare

🩹Fix

  • fix(react native): Property 'document' doesn't exist.

6.0.0(Dec 20, 2024)

23 Dec 08:19

Choose a tag to compare

Breaking Changes

Modified the runtime behavior of the following hooks to ensure concurrent mode safety:

  • useActiveElement
  • useCustomCompareEffect
  • useDarkMode
  • useLatest
  • usePrevious
  • useMouse

Warning: These changes will affect your applications. Using unstable references as prop parameters in these hooks may trigger infinite React re-renders, since these props are now included in the hooks' dependency arrays.

All DOM parameter passing now requires a stable reference. When using SSR mode, you might commonly pass functions like () => window. Make sure to extract these functions to the outer scope to maintain a stable reference, for example:

If you're passing DOM parameters using refs, you don't need to worry about this issue since refs always maintain stable references.

// Don't do this:
function Component() {
  useHook(() => window)
}

// Do this instead:
const getWindow = () => window
function Component() {
  useHook(getWindow)
}

Chore

List React19 as Dependency.

5.0.21(Aug 16, 2024)

16 Aug 04:06

Choose a tag to compare

🚀 Enhancements

  • feat(useLocalStorage): deprecated effectStorageValue, rename to mountStorageValue. add listenToStorageChanges option, default to true.

5.0.19(July 25, 2024)

25 Jul 08:08

Choose a tag to compare

🚀 Enhancements

  • feat: add usePreferredLanguages
  • feat: add useBroadcastChannel
  • feat: add useDevicePixelRatio
  • feat: add useElementByPoint
  • feat: add useQRCode

🩹Fix

  • fix next.js import error: SyntaxError: Named export 'a' not found. The requested module './index-client-Qon46B4S.js' is a CommonJS module, which may not support all module.exports as named exports.. which caused by use client with bunchee;