I have made a table that will accept an array of objects and display them. The table will not know ahead of time what this object is and different objects could be set throughout the life cycle of the table. I am using type any[] for this object array that is coming in.
Eslint typescript-eslint plugin recommends the rule no-explicit-any which warns against using explicit any.
Is there any way I can properly type this out to avoid the use of any or is this an actual use case for using any?
{}[]. If you want to access the properties then I'd suggest making an interface defining each property required and their types. - Morphyishnumber : string. Isanya good use for this? - Stevenfowler16{[key: number]: string}[]should do it. That defines an array of object with numeric keys and string values. - Morphyish{[key: number | string]: unknown}instead of any or {}. Edit: never mind key can only be a string or number not both - Stevenfowler16