Wpis z mikrobloga

Jak zasilić sprytnie interfejs w tsx RESTem tak by nie wypisywać każdego argumentu osobno?

np.:

export interface MyInterface {
a: string;
b: string;
...
z: string;
}

---

const [myInterface, setMyInterface] = useState();

getData().then((response) => {
setMyInterface({
a: response.a,
b: repsonse.b,
...
z: response.z
})
})

#javascript #typescript
  • 5