React state not updating with new data being fetched? – Javascript
I have a useFetchPokemon hook that includes the following code: import { useState, useEffect } from "react"; export const useFetchPokemon = () => { const initialUrl = "https://pokeapi.co/api/v2/pokemon" const [pokemon, setPokemon] = useState([]) as any; const [nextUrl, setNextUrl] = useState(null)…