I need to declare an array of objects, but unlike the other answers on StackOverflow my object is dynamic at runtime.
Example,
Possible [{"id":"1", "random1": "1", "random1": "1", "random1": "1"}]
Possible [{"id":"2", "p": "p2", "p2": "o2"}]
I have data: {}[] but where do I put the any?
const [data, setData] = useState({ data: {}[], isFetching: false });
Or can I define this in a way where I can say there will always be an id: string index but the rest can be any.
Something like this, which is not valid, but perhaps something like this is?
const [data, setData] = useState({ data: { [index: string]: any }[];, isFetching: false });