Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
fix react-native issue (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Baxley authored Jul 6, 2016
1 parent b597880 commit 1254af8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Expect active development and potentially significant breaking changes in the `0.x` track. We'll try to be diligent about releasing a `1.0` version in a timely fashion (ideally within 1 or 2 months), so that we can take advantage of SemVer to signify breaking changes from that point on.

### v0.3.15

Bug: Fixed issue where react native would error on aggressive cloneing of client

### v0.3.14

Feature: pass through all methods on apollo client
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-apollo",
"version": "0.3.14",
"version": "0.3.15",
"description": "React data container for Apollo Client",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 13 additions & 1 deletion src/connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,19 @@ export default function connect(opts?: ConnectOptions) {
clientProps.mutations = mutations;
}

const mergedPropsAndData = assign({}, props, clientProps, this.client, data);
const mergedPropsAndData = assign({}, props, clientProps, data);

// dynmically get all of the methods from ApolloClient
for (let key in this.client) {
if (!this.client.hasOwnProperty(key)) {
continue;
}
// don't overwrite any spyed methods like refetch
if (typeof this.client[key] === 'function' && !mergedPropsAndData[key]) {
mergedPropsAndData[key] = this.client[key];
}
}

if (
!haveOwnPropsChanged &&
!hasOwnStateChanged &&
Expand Down

0 comments on commit 1254af8

Please sign in to comment.