我正在尝试从API响应更新状态。我尝试以componentDidUpdate的身份使用useEffect,但组件持续呈现。我只想渲染一次。下面是代码快照, // I want to update to lookup data BlueLaws: [], ProdCodes: [], IdChecks: [], Tax: []// c
我有这个组件: import React, { Component } from 'react';
import useFetch from "..更新 感谢答案中的资源,但我找到了这个https://blog.bitsrc.io/fetching-data-in-react-using-hooks-c6fdd71cb24a 现在我把我的代码改成这样Hooks can only be called ins