我使用react useEffect从组件中的API中获取数据。props.getUserInfoAction() is an Action from redux dispatching user info useEffect(() => {React缺少一个依赖项:“props”。要么包含它,要么删除依赖数组。但是,当任何道具发生变化时,“props”都会发生变化,因此首选的修复方法是在useEffect</e
const history = useHistory() history.push(`/my/link`)
}, []) 然后react报告缺少依赖项history我不明白为什么history会成为这里的依赖项。它不是state变量,也不是来自props的变量。如果我将history添加到依赖数组中,是否会导致对useEffect的无限调用。const history