Skip to content

Commit 2a639ea

Browse files
authored
Merge pull request #25 from chenxsan/fix-add-undefined
Move Context to Provider
2 parents 7934c94 + 153e329 commit 2a639ea

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/Context.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/Provider.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
3-
import Context from './Context';
43
import mapStateOnServer from './server';
54

65
/* eslint-disable react/prop-types */
76

7+
const defaultValue = {};
8+
9+
export const Context = React.createContext(defaultValue);
10+
811
export const providerShape = PropTypes.shape({
912
setHelmet: PropTypes.func,
1013
helmetInstances: PropTypes.shape({

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
33
import fastCompare from 'react-fast-compare';
44
import invariant from 'invariant';
5-
import Context from './Context';
5+
import { Context } from './Provider';
66
import Dispatcher from './Dispatcher';
77
import { TAG_NAMES, VALID_TAG_NAMES, HTML_TAG_MAP } from './constants';
88

0 commit comments

Comments
 (0)