我通过useAxios钩子使用React API钩子来获取组件加载时的useEffect数据。Either include them or remove the dependency array react-hooks/exhaustive-deps//eslint-disable-line react-hooks/exhaustive-deps
但我觉得这么做是不对的!我可以毫无问题地将常量添加</
当我将currentPosition包含在useEffect依赖项数组中或删除它时,代码会变成一个无限循环。为什么?我对map也有同样的问题,但是当我将map放在依赖数组中时,就可以了。import { useState, useEffect } from "react";
import L from ";
const