Nic Lin's Blog
Recent content on Nic Lin's Blog
马上订阅 Nic Lin's Blog RSS 更新: https://blog.niclin.tw/index.xml
避免 React 中的 useEffect 無限 render
2020年2月23日 00:00
useEffect 會在 component 渲染完成後執行,類似 callback function 執行順序 invoke function component render execute function in useEffect 所以像我的 component 是從 redux 灌資料進來的,然後在 useEffect 中去 call api 來 fetch data。 結果就是掉進無限循環 fetch