Add Provider component
這個提交存在於:
父節點
1a7632e353
當前提交
7ee6396cb6
共有 1 個檔案被更改,包括 18 行新增 和 0 行删除
18
src/shared/store/provider.jsx
一般檔案
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;
|
新增問題並參考