In React with typescript, I tried defining the useState type as an object with string key/value pairs. I couldn't find the answer so I thought I'd add it.
I've tried this <{ [key: string]: string }>>
and some similar variations, but haven't successfully cracked it yet.
So this works ->
useState<{ [key: string]: string }>
:-)The best rubber duck ever! At least now it's here for everyone else