Add Provider component

This commit is contained in:
Shin'ya Ueoka 2017-10-09 13:27:24 +09:00
parent 1a7632e353
commit 7ee6396cb6

View file

@ -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;