xdl
Version:
The Expo Development Library
28 lines (22 loc) • 577 B
Flow
/**
* @flow
*/
import { getStore } from './store';
import { Component, PropTypes, Children } from 'react';
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';