Hello 🙂
I am using react-tiny-virtual-list in a real-world TypeScript project.
Apparently the type of scrollToAlignment prop has changed from string in v2.1.4 to enum ALIGNMENT in v2.2.0 and scrollToAlignment props which is not available at the moment in TypeScript because enum ALIGNMENT is not exported in index.d.ts
I could only use scrollToAlignment prop with a value of appropriate type namely enum ALIGNMENT as follows:
in some-project > node_modules/react-tiny-virtual-list/types/index.d.ts
export { DIRECTION as ScrollDirection, ALIGNMENT as scrollAlignment } from './constants';
in some-project > some-component
<VirtualList
width="99%"
height={100}
itemCount={5}
itemSize={30}
scrollToIndex={0}
renderItem={doSomething}
scrollToAlignment={scrollAlignment.AUTO}
onItemsRendered={doSomething}
/>
Appreciated if scrollToAlignment is available to use in TypeScript in v2.2.0.
I made the following PR to offer a solution to this issue:
https://github.com/clauderic/react-tiny-virtual-list/pull/69
Hello 🙂
I am using
react-tiny-virtual-listin a real-world TypeScript project.Apparently the type of scrollToAlignment prop has changed from
stringin v2.1.4 toenum ALIGNMENTin v2.2.0 and scrollToAlignment props which is not available at the moment in TypeScript becauseenum ALIGNMENTis not exported inindex.d.tsI could only use
scrollToAlignmentprop with a value of appropriate type namelyenum ALIGNMENTas follows:in some-project > node_modules/react-tiny-virtual-list/types/index.d.ts
in some-project > some-component
Appreciated if
scrollToAlignmentis available to use in TypeScript in v2.2.0.I made the following PR to offer a solution to this issue:
https://github.com/clauderic/react-tiny-virtual-list/pull/69