Reactjs – How to make TS check type any, when working with useState (React)?
import { useEffect, useState } from 'react' export type TTOrigin = { name: 'Name1' | 'Name2' url: string } export function App() { const [data, setData] = useState<TTOrigin[]>([]) useEffect(() => { fetch('https://swapi.dev/api/people/1/') .then((res) => res.json()) .then((json) => setData(json)) .catch((err) =>…