bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.32k stars 3.05k forks source link

registerChild prop is missing from WindowScroller #1392

Open vargajacint opened 5 years ago

vargajacint commented 5 years ago

Hi, i think it's enough for reporting the problem because it is valid. I'm using:

Property 'registerChild' does not exist on type 'WindowScrollerChildProps'

https://pastebin.com/embed_js/UF3z8gps

@bvaughn

mateja176 commented 5 years ago

I've come across the same issue while working with the WIndowScroller example

registerChild does not exist ( is missing from ) on type WindowScrollerProps. My guess is that the prop has been deprecated in favor of insert answer ( or the type is just misleading ).

vargajacint commented 5 years ago

I talked with a contributor and he told to me 'make a PR and we will fix'. I haven't time, but if you have just make a PR.

(Sorry for the linguistic errors).

alexandrzavalii commented 5 years ago

Same here :( had to use the old version

albanlorillard commented 1 month ago

registerChild seem to exist now in WindowScroller :

export type WindowScrollerChildProps = {
    ...
    registerChild: (element?: React.ReactNode) => void;
};

But the type not accept an Element like HTMLElement it's a problem because I can't do like the example here : image https://github.com/bvaughn/react-virtualized/blob/master/source/WindowScroller/WindowScroller.example.js

Typescript is disagree

Type (element?: ReactNode) => void is not assignable to type (instance: HTMLDivElement | null) => void

It's possible to change the method signature of registerChild ? It seem to be generated by typescript