aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-10-09 13:27:24 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-10-09 15:43:18 +0900
commit7ee6396cb6aab3aa85c76cf511e85579e6e989e6 (patch)
tree04ce4c25d4e7e123f9a5d5b012fc17d155d476db /src
parent1a7632e353d60d5c0fd46a8a3fa659889b6ae080 (diff)
Add Provider component
Diffstat (limited to 'src')
-rw-r--r--src/shared/store/provider.jsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/shared/store/provider.jsx b/src/shared/store/provider.jsx
new file mode 100644
index 0000000..743f656
--- /dev/null
+++ b/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;