maslianok / react-resize-detector

A Cross-Browser, Event-based, Element Resize Detection for React
http://maslianok.github.io/react-resize-detector/
MIT License
1.25k stars 91 forks source link

Missing type annotations for children #110

Closed solomon-gumball closed 3 years ago

solomon-gumball commented 3 years ago

Using v5 with latest type definitions: There are no special annotations for children so the args passed to the child function are of any type.

image Binding element 'width' implicitly has an 'any' type.

With a union type definition for valid props.children you could write an annotation for the argument passed to the child function of ReactResizeDetector.

Seems like a nice feature to have considering this is one of the recommended patterns! Let me know if you'd like me to help with this.

maslianok commented 3 years ago

The library has been rewritten in TypeScript.

The bug should be resolved in v6.0.0-alpha.1. Please check and let me know if the error still exists.

A stable release will be published in a few days.