Comments (4)
You probably have a container (maybe Redux) that has shouldComponentUpdate
and is blocking re-rendering.
from react-router-relay.
Thanks for the speedy response! Of the two components, the UserProfile (the one that works) is the only one that has a redux container.
One other thing that is different between the two, is that the Contracts are listed as search results on a page where I'm clicking from. I don't yet quite know how Relay's cache works or how smart it is about what it tries to refresh to fill in the missing details. But, even still, the search results have properties that should be in that cache, I would think.
I have the ContractDetail output the contract prop on render and when I click into it from the listing, I only get this, where it is an object, it just is missing all the data:
{dataID: "Q29udHJhY3QtMw=="}
When I do a page refresh, it outputs:
{__dataID__: "Q29udHJhY3QtMw=="
description:null
id:"Q29udHJhY3QtMw=="
title:"Contract Title"
website:null}
So, I too was wondering if it was a shouldComponentUpdate issue since it seems like it's confused about the fact that the contract prop existed but was unpopulated.
But, one would think if it were merely a case of it not re-rendering but where the data is actually in the Relay cache, then clicking on something else and coming back to the page, it should be able to populate from the cache... but it doesn't.
from react-router-relay.
I made some changes to the Graph definitions in Ruby, did some schema refreshes and it is now working... I'm not entirely sure what I did to fix it but the issue is gone. This can be closed.
from react-router-relay.
I have the same issue and I'm not sure that it needs own page, still seeking for the solution. When I switching between sibling pages (both have path /tag/:id
) child Posts component doesn't rerendered. But when I click Link from main page with path /
it render correctly. How to get rerendered Posts component inside Tag component when I'm on another Tag component with pressing Link to another /tag/:id
?
EDIT:
I've founded the mistake in my code, sry for question, but anyway I will share it, may be it will help somebody.
So in my child React component I had constructor property with this code:
this posts = this.props.tag && this.props.tag.posts.edges.length > 0
? this.props.tag.posts.edges
: this.props.viewer.posts.edges || []
I was removed constructor property and add this to render method:
const posts = this.props.tag && this.props.tag.posts.edges.length > 0
? this.props.tag.posts.edges
: this.props.viewer.posts.edges || []
My Posts component has two fragments tag or viewer, because this component can be used as a IndexRoute and as a TagPage child container for viewing tag related posts.
from react-router-relay.
Related Issues (20)
- [react-router] The middleware specified at index 0 does not appear to be a valid React Router middleware HOT 1
- GraphQL error gets stuck in parent route HOT 11
- PrepareParams per-component basis? HOT 2
- Single-Page App Sharing Variables / Single Query HOT 1
- query params routing HOT 1
- arguments of type GraphQLList are sent in two separate requests and doesnt work HOT 1
- How do I access the relay environment? HOT 1
- Supporting react-router 4.0 HOT 1
- How to handle "Object not found" cases? HOT 1
- Module not found: 'react-router/lib/getRouteParams' HOT 1
- Named components readyState change at same time even if queries not finished together HOT 2
- Compatible with React-Router latest version(4.x). HOT 1
- Go to url based on data recieved from Relay? HOT 1
- Use with react-router 4.0.0 HOT 5
- Incompatible With React-Router V4
- Make Compatible with Relay 2 HOT 20
- is this even possible ? HOT 1
- React 16 Compatability HOT 1
- Back via Browser History with state persisting? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-router-relay.