3 ms·
Yes I'm not sure myself if what I say makes sense when thinking it through again. I was thinking something like <WithPromises asyncProp={promise} asyncProp2
by moritzwarhier 2y ago
Yes I'm not sure myself if what I say makes sense when thinking it through again.
I was thinking something like
<WithPromises asyncProp={promise} asyncProp2={promise2}>
{(resolvedValues) => children(resolvedValues)}
</WithPromises>
But that's already possible to do yourself I guess, but better in different way.
E.g. not using a function prop as "children" etc.
Many libraries also provide nice and clean interfaces to provide async state (e.g. react-query) and then of course there's good old useEffect.
I think I see why they use a different approach.
Guess I'd mainly just love a streamlined API for data fetching built into the core.
Right now it's a lot better to just have async code outside of react change prop values.
Love the section on client data fetching in the react docs though.