GT2/GT2-iOS/node_modules/xdl/build/state/XDLProvider.js.flow

30 lines
603 B
Plaintext
Raw Normal View History

2018-02-12 17:26:06 +00:00
/**
* @flow
*/
import PropTypes from 'prop-types';
import { Component, Children } from 'react';
import { getStore } from './store';
export default class XDLProvider extends Component {
getChildContext() {
return { xdlStore: this.store, xdlStoreSubscription: null };
}
constructor(props, context) {
super(props, context);
this.store = getStore();
}
render() {
return Children.only(this.props.children);
}
}
XDLProvider.childContextTypes = {
xdlStore: PropTypes.object.isRequired,
xdlStoreSubscription: PropTypes.object,
};
XDLProvider.displayName = 'XDLProvider';