petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.25k stars 301 forks source link

Improved TypeScript support #261

Closed fabiospampinato closed 3 years ago

fabiospampinato commented 3 years ago

I'm having troubles typing well this component:

const Scroller = useCallback ( forwardRef ( ( { style, children }, ref ) => {
  return (
    <div style={style} ref={ref}>
      {children}
    </div>
  );
}), [] );

There should be TypeScript types importable from the 'react-virtuoso' package for each of these components Virtuoso accepts, and types for each props object they accept, without them overriding a component and typing it well is way more difficult than it should be.

petyosi commented 3 years ago

Agreed, typings are an improvement.

petyosi commented 3 years ago

Addressed in the 6b3413e7f437db79b489bc873a1dd45e9c100d75, released in v1.2.7.