Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@mantine/hooks] use-scroll-into-view: Fix parameters changes being i…
…gnored (#2866) * Fix useScrollIntoView ignoring parameter changes Currently, useScrollIntoView returns a memoized callback that always refers to the params passed during the first render of the calling component, so calling with dynamically computed params, e.g. useScrollIntoView({ offset: someVariable }) will memoize the offset passed during the first render. If the component re-renders, any new offset passed is ignored. Aditionally, 'scrollableRef.current' is an invalid dependency, see https://epicreact.dev/why-you-shouldnt-put-refs-in-a-dependency-array/ * Replace tab with 4 spaces * Remove ref dependency
- Loading branch information