You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that this library might not be 100% compatible with a fetchQuery.
Imagine the following setup:
There are 2 pages, PageA and PageB which have a QueryA and QueryB connected to them respectively.
We are using relay-query-lookup-renderer only to read from the Relay store, data fetching is done independently via fetchQuery.
The user journey is:
Visits PageA. QueryA is fetched on the server, Relay store records are used to hydrate the store on the client. QueryLookupRenderer reads the data from Relay store by being rendered with query={QueryA} and render={({props}) => <ComponentA data={props}/>}
Travels from PageA to PageB.
QueryB is fetched via the fetchQuery
QueryLookupRenderer is re-rendered with query={QueryB} and render={({props}) => <ComponentB data={props}/>}, data is already in the store
Travels from PageB to PageA
QueryA is fetched via the fetchQuery
Possible bug - before QueryLookupRenderer is re-rendered with query={QueryA} it actually invokes the render function with props corresponding to QueryA, even though the render itself is still ({props}) => <ComponentB data={props}/> and the query prop is still QueryB
QueryLookupRenderer is re-rendered with query={QueryA} and render={({props}) => <ComponentA data={props}/>}
I suppose that it has to do something with QueryA already being present in the Relay store. Recreating a store on every page transition fixes it.
The text was updated successfully, but these errors were encountered:
Hi!
I think that this library might not be 100% compatible with a
fetchQuery
.Imagine the following setup:
PageA
andPageB
which have aQueryA
andQueryB
connected to them respectively.relay-query-lookup-renderer
only to read from the Relay store, data fetching is done independently viafetchQuery
.The user journey is:
PageA
.QueryA
is fetched on the server, Relay store records are used to hydrate the store on the client.QueryLookupRenderer
reads the data from Relay store by being rendered withquery={QueryA}
andrender={({props}) => <ComponentA data={props}/>}
PageA
toPageB
.QueryB
is fetched via thefetchQuery
QueryLookupRenderer
is re-rendered withquery={QueryB}
andrender={({props}) => <ComponentB data={props}/>}
, data is already in the storePageB
toPageA
QueryA
is fetched via thefetchQuery
QueryLookupRenderer
is re-rendered withquery={QueryA}
it actually invokes therender
function withprops
corresponding toQueryA
, even though therender
itself is still({props}) => <ComponentB data={props}/>
and thequery
prop is stillQueryB
QueryLookupRenderer
is re-rendered withquery={QueryA}
andrender={({props}) => <ComponentA data={props}/>}
I suppose that it has to do something with
QueryA
already being present in the Relay store. Recreating a store on every page transition fixes it.The text was updated successfully, but these errors were encountered: