GH5T
4
Hi @bensonlangley.
What I do is whenever I “Do a Search for” something, I attach it to a reusable component that is on all my pages. Inside this element I can set states, and the data consistantly throughout my app.
This is easily accomplished by sending your state (your API data you fetched prior) to your other reusable elements throughout your application, therefor the data only needs to be fetched once on page load (or setup a flag to update the data on an interval).
This will prevent you from searching for a data-type more than once, and can scope easily from your source from anywhere.
Page
- [Reusable] HEADER (A state inside here is where your data lies)
- Content
– [Reusable] Page (takes a prop for any data type) - Set it to the headers state.
Hope this gives you more insight on WU optimization.
Are you sure? Pretty sure it’s a fetch still (technically).