Skip to content

Commit 0e0840d

Browse files
authored
Merge pull request #60 from denvned/relay-10
Support Relay v0.10.0
2 parents 5f94004 + 5828689 commit 0e0840d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isomorphic-relay",
3-
"version": "0.7.3",
3+
"version": "0.7.4",
44
"description": "Adds server side rendering support to React Relay",
55
"author": "Denis Nedelyaev",
66
"homepage": "https://github.com/denvned/isomorphic-relay",
@@ -34,7 +34,7 @@
3434
},
3535
"peerDependencies": {
3636
"react": "^0.14.8 || ^15.0.1",
37-
"react-relay": "0.9.3"
37+
"react-relay": "0.9.3 - 0.10.0"
3838
},
3939
"devDependencies": {
4040
"babel-cli": "^6.7.5",

src/IsomorphicRenderer.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export default class IsomorphicRenderer extends React.Component {
2828
}
2929
}
3030

31-
_runQueries({ Container, forceFetch, queryConfig, environment }) {
31+
_runQueries({ Container, forceFetch, queryConfig, environment, shouldFetch }) {
32+
if (!shouldFetch) {
33+
return;
34+
}
35+
3236
const onReadyStateChange = readyState => {
3337
if (!this.mounted) {
3438
this._handleReadyStateChange({...readyState, mounted: false});
@@ -71,6 +75,7 @@ export default class IsomorphicRenderer extends React.Component {
7175
nextProps.Container !== this.props.Container ||
7276
nextProps.environment !== this.props.environment ||
7377
nextProps.queryConfig !== this.props.queryConfig ||
78+
nextProps.shouldFetch && !this.props.shouldFetch ||
7479
nextProps.forceFetch && !this.props.forceFetch
7580
) {
7681
this._runQueries(nextProps);
@@ -129,4 +134,9 @@ IsomorphicRenderer.propTypes = {
129134
queryConfig: Relay.PropTypes.QueryConfig.isRequired,
130135
environment: Relay.PropTypes.Environment,
131136
render: React.PropTypes.func,
137+
shouldFetch: React.PropTypes.bool,
138+
};
139+
140+
IsomorphicRenderer.defaultProps = {
141+
shouldFetch: true,
132142
};

0 commit comments

Comments
 (0)