Repository navigation
Patch Changes
-
#605
6a916fcThanks @KooYS! -disableBodyScrollLock(and souseBodyScrollLockon unmount) now returns the page to the state it was in before the lock. It puts back the inlineoverflow,position,top,left,rightandbottomstyles thebodyhad, including!important, instead of removing them; a property that other code changed while the body was locked is left as it is. It also jumps back to the saved scroll position withbehavior: 'instant'; before, when the root element (html) hadscroll-behavior: smooth, the page jumped to the top and animated back to that position. -
#592
1ead5b0Thanks @Choi-Jung-Hyeon! -useList,useSetanduseMapno longer serializeinitialStatewithJSON.stringifyon every render. Before, they threw on the first render when the initial values held aBigIntor a circular object.resetnow always uses the latestinitialState; foruseSetanduseMapit used to keep the firstSetorMapit was given. -
#615
515b10eThanks @h00ns! -useOutsideClickEffectno longer calls the callback for the click that rendered its container. React runs the effects of a click's update before that click reachesdocument, so a popup opened by a button outside it closed again on the same click. Whenever a new container element appears, including on the first render, clicks are now ignored until asetTimeout(0)fires. A test that clicks outside right after rendering needs to wait for that timer first, for example withawait act(() => new Promise(resolve => setTimeout(resolve, 0))), orvi.advanceTimersByTime(0)with fake timers. -
#602
5fa5149Thanks @JeongHwan-dev! -subscribeKeyboardHeightnow delivers the latest keyboard height once the throttle window ends. Before, events that fired while a window was open were dropped, so a keyboard animation that finished inside the window left the callback at an intermediate height. -
#591
8c56151Thanks @Choi-Jung-Hyeon! -SwitchCasenow only matches keys defined oncaseByitself. Before, a value such as'toString'or'constructor'matched a method inherited fromObject.prototype, so the component rendered[object Undefined]or threw instead of renderingdefaultComponent. -
#594
ac96b38Thanks @Choi-Jung-Hyeon! -useGeolocationno longer leavesloadingstuck attruewhenstopTracking()is called before the first position arrives. A watch started withstartTracking()also keeps running when a position option such asenableHighAccuracychanges. Before, the watch was cleared without being restarted whileisTrackingstayedtrue. -
#603
a07827fThanks @JeongHwan-dev! -useIntersectionObservernow passes the latest entry of a batch to the callback. Before, it read only the first entry, so when an element entered and left the viewport within one observer tick the callback received the stale "entered" entry and missed the exit. -
#598
cd66595Thanks @Choi-Jung-Hyeon! -useScrollDirectionre-checkswindow.scrollYwhen the throttle timer ends. Before, a scroll that stopped inside the throttle window leftpositionstale. -
#596
d48b1ebThanks @Choi-Jung-Hyeon! -useStorageState'srefreshStateno longer writes to storage. Before, it wrote the current snapshot back, so calling it on an empty key persisteddefaultValue.