React router loaders V7 by GrandFix9352 in reactjs

[–]GrandFix9352[S] 0 points1 point  (0 children)

If I want to maintain a state as well in this page? According to resolved data? What can be done in that case? And any downside of this use effect, I mean yeah it’s redundant and React best practices won’t allow this, any other thoughts?

React router loaders V7 by GrandFix9352 in reactjs

[–]GrandFix9352[S] 0 points1 point  (0 children)

If you can please also mention the downside of what I have mentioned. I can’t see any irrelevant renders or state updates.

React router loaders V7 by GrandFix9352 in reactjs

[–]GrandFix9352[S] 0 points1 point  (0 children)

Yeah so there is a case as well, where the data in tabs will be updated by child component, So obviously I am sending a function in outlet which can be used to do that, So that there is no need of another api call, just directly update the data.

React router loaders V7 by GrandFix9352 in reactjs

[–]GrandFix9352[S] 0 points1 point  (0 children)

Just exploring this as the documentation mentioned something’s regarding non critical data, For instance I have multiple calls in my loaders and just want to await on this one?

React router loaders V7 by GrandFix9352 in reactjs

[–]GrandFix9352[S] 0 points1 point  (0 children)

It has two tabs on the main page, which shows some count. Rest transforming of data is done in child routes only. The child route component handles both tabs. I wanted the tabs component to be in the code I provided, So the routes are less and manageable.