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

30 lines
603 B
Plaintext
Raw Normal View History

/**
* @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';