Skip to content

Commit

Permalink
Fix preload for React v16.3.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanWooldridge committed Apr 4, 2018
1 parent b738c63 commit 7f21e1f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## Next

* Updated dependencies.
* Updated the `react` peer dependency to `^16.3.1`.
* Fixed `preload` broken due to the [React v16.3.1](https://github.com/facebook/react/releases/tag/v16.3.1) [context API change](https://github.com/facebook/react/pull/12501).
* Example updates:
* Valid length app manifest `short_name`.
* Added `<html>` `lang` attribute.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"browserslist": ">1%",
"peerDependencies": {
"react": "^16.3.0-alpha.1"
"react": "^16.3.1"
},
"dependencies": {
"extract-files": "^3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/preload.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export function preload(element) {
element.props.children
) {
// If the element is a context provider first set the value.
if (element.type.context)
element.type.context.currentValue = element.props.value
if (element.type._context)
element.type._context.currentValue = element.props.value

recurse(element.props.children, legacyContext)
}
Expand Down

0 comments on commit 7f21e1f

Please sign in to comment.