From 36ed88458bb8af155897685eec72d68d96cdbf17 Mon Sep 17 00:00:00 2001 From: Va Da Date: Sat, 9 Jun 2018 16:27:56 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20include=20React=20correct?= =?UTF-8?q?ly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/context/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/context/index.ts b/src/context/index.ts index 2139490c..72ee1216 100644 --- a/src/context/index.ts +++ b/src/context/index.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import faccToHoc from '../util/faccToHoc'; const contexts = {}; @@ -7,7 +7,7 @@ const getOrCreateContext = (name: string) => { let context = contexts[name]; if (!context) { - context = contexts[name] = React.createContext(); + context = contexts[name] = React.createContext({}); } return context; @@ -66,7 +66,7 @@ export class Consumer extends React.Component { return null; } - return React.createElement(context.Consumer, {}, this.props.children); + return React.createElement(context.Consumer, {}, children); } }