Getting data into React components.
import React, {useEffect, useState} from 'react';function App() {const [state, setState] = useState<number | undefined>();useEffect(() => {fetch("url").then(res => res.json()).then(res => setState(res));}, [])if (!state) {return <div>...loading</div>}return <div>count from the api is: {state}</div>}