Fetching data with hooks
问题 I'm having a hard time to wrap my head around the best way to fetch data from an API only once (and when it's first requested) and then storing the result for reuse and/or other component functions. Below is a working example with useContext and useReducer , but it's quite complex for such an "easy" task. Is there a better approach? And what's the best way to implement this for a large amount of API calls. Any suggestions are greatly appreciated. import React from "react"; import ReactDOM