Skip to content

Commit effac1b

Browse files
committed
Fix preload for React v16.3.1.
See facebook/react#12501 (comment).
1 parent f81d71b commit effac1b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## Next
44

55
* Updated dependencies.
6+
* Updated the `react` peer dependency to `^16.3.1`.
7+
* 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).
68
* Example updates:
79
* Valid length app manifest `short_name`.
810
* Added `<html>` `lang` attribute.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"browserslist": ">1%",
3636
"peerDependencies": {
37-
"react": "^16.3.0-alpha.1"
37+
"react": "^16.3.1"
3838
},
3939
"dependencies": {
4040
"extract-files": "^3.1.0",

src/preload.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ export function preload(element) {
111111
element.props.children
112112
) {
113113
// If the element is a context provider first set the value.
114-
if (element.type.context)
115-
element.type.context.currentValue = element.props.value
114+
if (element.type._context)
115+
element.type._context.currentValue = element.props.value
116116

117117
recurse(element.props.children, legacyContext)
118118
}

0 commit comments

Comments
 (0)