Skip to content

Commit 877b08e

Browse files
committed
fixup merge childContextTypes from options and first node
1 parent 397ddfd commit 877b08e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ReactWrapperComponent.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ export default function createWrapperComponent(node, options = {}) {
7777
// OR the merged context types for all children (the node component or deeper children) are
7878
// specified in options parameter under childContextTypes.
7979
// In that case, we define both a `getChildContext()` function and a `childContextTypes` prop.
80-
let childContextTypes = node.type.contextTypes;
80+
const childContextTypes = node.type.contextTypes || {};
8181
if (options.childContextTypes) {
82-
childContextTypes = options.childContextTypes;
82+
objectAssign(childContextTypes, options.childContextTypes);
8383
}
8484
objectAssign(spec, {
8585
childContextTypes,

0 commit comments

Comments
 (0)