parent
1a7632e353
commit
7ee6396cb6
1 changed files with 18 additions and 0 deletions
@ -0,0 +1,18 @@ |
||||
import React from 'react'; |
||||
import PropTypes from 'prop-types'; |
||||
|
||||
class Provider extends React.PureComponent { |
||||
getChildContext() { |
||||
return { store: this.props.store }; |
||||
} |
||||
|
||||
render() { |
||||
return React.Children.only(this.props.children); |
||||
} |
||||
} |
||||
|
||||
Provider.childContextTypes = { |
||||
store: PropTypes.any, |
||||
}; |
||||
|
||||
export default Provider; |
Reference in new issue