I am working on converting the JSON to typescript interface and unbale to map the same.
I have the below format JSON string
{
"abc": [
{"key": "a", "value": "a"},
{"key": "b", "value": "b"},
{"key": "c", "value": "c"}
],
"cdf": [
{"key": "a", "value": "a"},
{"key": "b", "value": "b"},
{"key": "c", "value": "c"}
]
}
I would like to define the class for it in the react but facing issues. Could any one please help to declare the typescript class for the above JSON.
Thanks in advance
>Solution :
type Inner = {key: string, value: string}
type Thing = {
abc: Inner[],
cdf: Inner[]
}