How to work with Fragment when there are data-altering functions in between components #9377
Unanswered
RareSecond
asked this question in
Q&A
Replies: 1 comment
-
|
You should define a fragment in your |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So we are trying to go all-in on the fragments approach that is being proposed in a recent blog post by The Guild.
However, while trying to implement it, we came across an issue that we've had some issues wrapping our head around.
Say we have a child component that renders a
CompletedOrder, let's say some pseudo code of the render functionCompletedOrder
There is also a parent that gets in all the orders, and renders based on the order status
OrderList
And then there's another parent that does the data fetching and sorts the orders per week, so it returns a
Mapwhere the keys are the weeknumbers and the values are the orders for that weeknumber.So this initial top parent does the fetching itself.
Orders
But the big question is: how can we type the
props correctly and how can we do the root query that is then composed of all the fragments.Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions