Minor Changes
-
#574
402995eThanks @DongEun02! - Pass the previous state value as the second argument to useInputState's transformValue callback. -
#571
a62e7d6Thanks @hyesungoh! - The emitted declarations ofusePreservedCallback,useDebounce,useThrottleanduseCallbackOncePerRendernow name their callback parameter typeCallerTypedArgsinstead ofany[]. It is the same type, so they accept the same callbacks.useThrottlealso constrains the callback's return type tounknowninstead ofany, which accepts the same callbacks.The throttled function returned by
useThrottlenow accepts the callback's parameters instead ofany[], so calling it with arguments the callback does not take is a type error. The return types ofuseThrottleanduseDebounceare now written out in their declarations, so a consumer that emits declarations can export their result without a TS2742 error.
Patch Changes
-
#572
cf0dd83Thanks @GamjaIsMine02! - Document thatuseOutsideClickEffectacceptsnullentries in container arrays, matching its existing type and behavior. -
#569
8ead31dThanks @GamjaIsMine02! - MarkuseImpressionRef'srootMarginoption as optional in the JSDoc and documentation, matching its existing type. -
#575
5a21c39Thanks @GamjaIsMine02! - Allow readonly arrays as the initial state andsetAllinput ofuseList. -
#579
8828710Thanks @KooYS! -useDoubleClicknow runsclickimmediately for clicks that carry no click count (event.detail === 0), such as Enter/Space on a native button or a programmaticelement.click(). The handler only recogniseddetail1 and 2, so these clicks were dropped, and they also cancelled a pending mouse click.doubleClickis still only called fordetail === 2. -
#577
89ad72eThanks @rjsgud49! -useLoadingnow keepsloadingastrueuntil every promise passed tostartLoadinghas settled. Before, when two calls overlapped, the first promise to settle setloadingtofalsewhile the other was still pending. -
#576
7e8c88aThanks @rjsgud49! -useLongPressno longer callsonClicktwice for a tap on touch devices. Aftertouchend, browsers fire emulatedmousedown/mouseupevents on the same element, and the hook handled them as a second, mouse press. That also calledonClickafteronLongPressEndwhen the long press came from touch. Mouse presses that start within 1 second of a touch event are now ignored. -
#567
d8e8147Thanks @rjsgud49! -useScrollDirectionno longer stops tracking scroll whenthrottleMschanges, or the component's effects re-run, while a throttle window is still open. The cleanup cleared the pending timer but left its id in the ref, so the next listener treated every scroll as throttled. -
#578
4b9a4aaThanks @mmporong! - MarkuseMap'sinitialStateparameter as optional in the JSDoc and documentation, matching its existing default ofnew Map().