Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Should the prop 'renderItem' of List component be optional in TypeScript interface, or the example code in the Document has a bug? #16587
Steps to reproduce
Use a List component in a react app, without renderItem prop
What is expected?
‘renderItem’ is required in the interface ListProps. As the react-virtualized example in the document of List component shown, 'renderItem' is not used and there should not be any type error.
What is actually happening?
Actually in TypeScript environment, the 'prop' renderItem is required and if I copy the example code to my project, it will raise an TypeScript error:
Although I use email@example.com, the definition of renderItem is still not optional in the latest version of code.