✅ – Ygg – 22-32 Mar 8
Hello, I'm using a
FreeCompanyContext
to use some variables across my website
One of then is using a function
to fetch a list of objects from an api.
The list can be lenghty so I decided to track the progress to show it in the UI :
And then I'm using it in the component:
Everything works just fine, except that fetchProgress
is a useState
so it re-renders everytime it changes and that make the whole page a mess to use (since it's re-rendering the whole page)
The gif is just to show the :hover
effect going crazy because of that, this re-renders also make it harder to click the tabs.
So, my question: what's the best approach to this?
I'm a newbie so any obvious suggestions could end up being great!5 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I see! So if I wrap the
loading
around it, it'll only re-render this component? Or I should wrap the whole page?Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I'll learn more about it, I answered based on a quickly search. That's something I wasn't aware it even exist for your time! Really helped!
This question has an answer! Thank you for helping 😄
If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/1083155331854635152
This thread hasn’t had any activity in 12 hours, so it’s now locked.
Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/1083155331854635152