Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError : RegisterChild in WindowScroller #1829

Open
chelsadaptry98 opened this issue Jan 8, 2024 · 0 comments
Open

TypeError : RegisterChild in WindowScroller #1829

chelsadaptry98 opened this issue Jan 8, 2024 · 0 comments

Comments

@chelsadaptry98
Copy link

Bug Report

I am using react-virtualized in React 18 with typescript. RegisterChild in windowScroller gives a typeError when used as a ref.

What is the current behavior?

When I use

I get an an error as :

Type '(element?: ReactNode) => void' is not assignable to type 'LegacyRef<HTMLDivElement> | undefined'.
  Type '(element?: ReactNode) => void' is not assignable to type '(instance: HTMLDivElement | null) => void'.
    Types of parameters 'element' and 'instance' are incompatible.
      Type 'HTMLDivElement | null' is not assignable to type 'ReactNode'.
        Type 'HTMLDivElement' is not assignable to type 'ReactNode'.
          Type 'HTMLDivElement' is missing the following properties from type 'ReactPortal': type, props, key

Screenshot 2024-01-08 at 10 49 52 PM

How can I solve this error?

If I use onChildScroll, I get a warning in console for ReactDomNode

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of WindowScroller which is inside StrictMode. Instead, add a ref directly to the element you want to reference

What is the expected behavior?

registerChild should work as ref correctly.

Which versions of React and react-virtualized, and which browser / OS are affected by this issue? Did this work in previous versions of react-virtualized?

I am trying to update to react 18 from react 17 and encountered this issue

Browser Chrome
OS Mac
React 18.0.2
React DOM 18.0.2
react-virtualized 9.22.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant