Add Provider component

jh-changes
Shin'ya Ueoka 7 years ago
parent 1a7632e353
commit 7ee6396cb6
  1. 18
      src/shared/store/provider.jsx

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