graphql-react
Advanced tools
Comparing version 3.0.0 to 4.0.0
# graphql-react changelog | ||
## 4.0.0 | ||
### Major | ||
- Updated the `react` peer dependency to `^16.6.0`. | ||
- Fixed `preload` broken due to the [React v16.6.0](https://github.com/facebook/react/releases/tag/v16.6.0) [context API change](https://github.com/facebook/react/pull/13829), fixing [#11](https://github.com/jaydenseric/graphql-react/issues/11). | ||
### Patch | ||
- Updated dev dependencies. | ||
## 3.0.0 | ||
@@ -4,0 +15,0 @@ |
@@ -10,2 +10,5 @@ 'use strict' | ||
const hasSymbol = typeof Symbol === 'function' && Symbol.for | ||
const REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace | ||
function preload(element) { | ||
@@ -29,3 +32,4 @@ const recursePreload = ( | ||
element.type && | ||
(element.type.Consumer || typeof element.type === 'function') | ||
(element.type.$$typeof === REACT_CONTEXT_TYPE || | ||
typeof element.type === 'function') | ||
) { | ||
@@ -37,5 +41,5 @@ const props = (0, _objectAssign.default)( | ||
) | ||
if (element.type.Consumer) | ||
if (element.type.$$typeof === REACT_CONTEXT_TYPE) | ||
recurse( | ||
element.props.children(element.type.currentValue), | ||
element.props.children(element.type._context.currentValue), | ||
legacyContext | ||
@@ -42,0 +46,0 @@ ) |
{ | ||
"name": "graphql-react", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "A lightweight GraphQL client for React.", | ||
@@ -37,3 +37,3 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"react": "^16.3.1" | ||
"react": "^16.6.0" | ||
}, | ||
@@ -61,3 +61,3 @@ "dependencies": { | ||
"eslint": "^5.7.0", | ||
"eslint-config-env": "^1.1.0", | ||
"eslint-config-env": "^1.2.0", | ||
"eslint-config-prettier": "^3.1.0", | ||
@@ -72,8 +72,8 @@ "eslint-plugin-import": "^2.14.0", | ||
"jsdoc-md": "^1.6.0", | ||
"koa": "^2.5.3", | ||
"koa": "^2.6.1", | ||
"koa-bodyparser": "^4.2.1", | ||
"lint-staged": "^7.3.0", | ||
"prettier": "^1.14.3", | ||
"react": "^16.5.2", | ||
"react-dom": "^16.5.2", | ||
"react": "^16.6.0", | ||
"react-dom": "^16.6.0", | ||
"size-limit": "^0.20.1", | ||
@@ -80,0 +80,0 @@ "tap": "^12.0.1", |
Sorry, the diff of this file is not supported yet
58052
666