Is it possible? Can we use FragmentContainer outside a QueryRenderer?
What I want to achieve:
I have a RefetchContainer with a SectionList. Every item inside each section is a FragmentContainer. When I select an item from a section, I want to open a new screen where I display a FlatList of these items. The data I pass from the SectionList on item select is a list of FragmentContainer. Thus I can't see the data so I need to use fragments for it. If I use just fragments inside the FlatList I get a missing environment from the RelayFragmentContainer.
So I added a QueryRenderer as parent for the FlatList where I request the same single section once again. But this makes an extra QueryRenderer request. I want to display the data from the previous screen.
At least I pass this list of FragmentContainer as cacheConfig and return it from the fetchQuery method but, the json differs from the response json hence it is not raw data but already __fragments, thus the Relay cannot parse it.
relay-modern FragmentContainer outside QueryRenderer
394 Views Asked by parohy At
1
There are 1 best solutions below
Related Questions in REACTJS
- What is `_dereq_()` inside React?
- React TypeError: React.renderComponent is not a function
- React - saving a component in the ref callback
- React Rails component: manually triggering a re-render
- React, ES6 - getInitialState was defined on a plain JavaScript class
- How to get multiple selected options value in React JS?
- React.render replace container instead of inserting into
- reactjs datagrid use html
- props is not initialized in react component
- How to display xml data using Reactjs
- hooking up the data model in ReactJS - syntax
- ReactJS: How to use an immutable empty array or object
- How to use Sinon.js FakeXMLHttpRequest with superagent?
- React select onChange is not working
- ReactJS - Tutorial Comment System > Threaded commenting
Related Questions in REACT-NATIVE
- React Native: detect if UIVisualEffectView is supported
- Prevent Chrome debugger from stealing focus in React Native
- React-native upload image to amazons s3
- react-native update NavigatorIOS component's props
- promise – can't find variable process
- Using React Native within existing iOS app for some views only
- What is a good approach to building and distributing a React Native iOS component that extends iOS functionality?
- error in xcode 6 "is not registered as a URL scheme. Please add it in your Info.plist"
- DeviceEventEmitter stops emitting events to application when screen locked
- How to rename react-native entry file (index.ios.js)
- react-native component lifecycle methods not firing on navigation
- How to use comments in React
- react-native propagate changes in props through ListView and Navigator
- How do i use the iOS shake gesture with react native?
- TouchableHighlight won't accept press events while keyboard is open
Related Questions in RELAYJS
- How to define Relay fragment for GraphQLList of GraphQLObjectType?
- relayjs: Attempted to add an ID already in GraphQLSegment:
- Authorization in GraphQL servers
- How does graphql-java library execute Relay requests?
- relayjs and graphql error: Error: "Node" expects field "id"
- unable to render nested props from Github's GraphQL
- Why does Relay need a mutation id to reconcile GraphQL mutations?
- Maintaining an ordered list in graphql/relay
- Delegating fragments to children with Relay
- Filtering a list of names with ReactJS using data from RelayJS without calling GrpahQL
- React-Relay older browser support (blank site)
- How do I set default props for a component wrapped in a Raley container?
- How do I filter Relay results based on values in fields on Connected Types?
- Can I pull deeply-nested nodes from a Relay query result?
- Does relay require an id field in the the database?
Related Questions in RELAYMODERN
- async await inside function not working properly?
- Relay QueryRenderer fragmentContainer passed props different from server response because id conflict
- how to pass filter arguments to relay loadMore
- How to unsubscribe in Relay Modern
- Relay modern + GraphQL + found-relay - transformation before child gets a fragment
- Relay Modern Mutations, RANGE_ADD / Append
- Variable is not in scope error when relay-compiling Relay Modern code
- How can I share the same form for creating and updating an object in relay-modern (experimental)?
- Flow type relay's createFragmentContainer
- Graphcool RELAY Subscription: subscribe to edges
- How can I have multiple sibling instances of the same top level fragment container?
- React Modern - filter PaginationContainer
- Importing react-relay-network-modern in cypress fails
- React Error boundary unexpected behavior with material ui popover
- react-relay Invalid use of @refetchable on fragment
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It would be good to get some code examples in this question of what your components and fragments look like. That said, you might want to investigate using the
@maskdirective.I've taken an example from the Relay documentation and included it here:
By using the
@maskdata included from a fragment will be available in the component that is hosting the fragment. Relay documentation about this is available here: https://facebook.github.io/relay/docs/relay-directives.html#relay-mask-boolean