virtual icon indicating copy to clipboard operation
virtual copied to clipboard

fix(react-virtual): handle `scrollElement` cleanup after HMR

Open hophiphip opened this issue 1 year ago • 0 comments

When HMR is triggered useEffect cleanup function will call function returned from instance._didMount(). This will set scrollElement to null and Virtualizer will stop working.

I added an additional check if scrollElement is null and if it is - call instance._willUpdate().

This PR resolves https://github.com/TanStack/virtual/issues/750.

hophiphip avatar Aug 30 '24 08:08 hophiphip