Definitelytyped: No types for VirtualizedList from "react-native"

Created on 24 Dec 2017  路  6Comments  路  Source: DefinitelyTyped/DefinitelyTyped

import { VirtualizedList } from "react-native"; // has no exported member 'VirtualizedList'.

Any roadmap to implement types for this?
Can this be marked as Definition: Request?

Most helpful comment

add this @types/react-native/index.d.ts

export class VirtualizedList<ItemT> extends React.Component<
  VirtualizedListProps<ItemT>
> {
  scrollToEnd: (params?: { animated?: boolean }) => void;
  scrollToIndex: (
    params: {
      animated?: boolean;
      index: number;
      viewOffset?: number;
      viewPosition?: number;
    }
  ) => void;
  scrollToItem: (
    params: { animated?: boolean; item: ItemT; viewPosition?: number }
  ) => void;
  scrollToOffset: (params: { animated?: boolean; offset: number }) => void;
  recordInteraction: () => void;
}

All 6 comments

any update on this ?

no update after six months... dead place

+1. Is there any method to add the definition of VirtualizedList into the module react-native?

add this @types/react-native/index.d.ts

export class VirtualizedList<ItemT> extends React.Component<
  VirtualizedListProps<ItemT>
> {
  scrollToEnd: (params?: { animated?: boolean }) => void;
  scrollToIndex: (
    params: {
      animated?: boolean;
      index: number;
      viewOffset?: number;
      viewPosition?: number;
    }
  ) => void;
  scrollToItem: (
    params: { animated?: boolean; item: ItemT; viewPosition?: number }
  ) => void;
  scrollToOffset: (params: { animated?: boolean; offset: number }) => void;
  recordInteraction: () => void;
}

When I go to make a new issue on this repo it says to @-mention the authors of the file in question, otherwise it'll be ignored. Since this is an old issue, and that wasn't done here (presumably that issue template didn't exist when the issue was created), I'm gonna try mentioning them in a comment in the hopes that it helps:

@alloy @huhanming @iRoachie @Skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @Esemesek @mrnickel @souvik-ghosh @nossbigg @saranshkataria

@adambrenecki Thanks for the ping!

To address e.g. @zjh1943鈥檚 question, the maintainers of the react-native typings don鈥檛 really take requests鈥搕hat is, we add what we use to ensure our additions are correct. So I would invite the people on this thread to do the same and submit a PR with typings that work for them (the ones by @tenkeyless look like a great starting point), after which we鈥檒l be happy to review it!

Was this page helpful?
0 / 5 - 0 ratings