How to send data from a fragment to a deep nested component?

I work with Relay Modern on Project. But I'm not sure how to send data from a place when I put a fragment in the place where the component is located.

eg:

this is the composition of the components

-Page (QueryRenderer)
---Header
---body
  ---List
     --UserAutocomplete

A list is a fragment, something like fragment PaymentsList on Payment UserAutocomplete is also a fragment, but on RootQueryfragment UserAutocomplete_users on RootQuery

Actually, I put this snippet in a query for QueryRenderer graphql` query PaymentQuery { ...PaymentsList ...UserAutocompleteFragment_users }

But then I got the data for UserAutocomplete here, and I have to send this data for the UserAtocomplete component down through the details. Is there any better way to get such data from the store instead of sending it through the details?

+4
source share

Source: https://habr.com/ru/post/1689110/


All Articles