mirror of
https://github.com/wassname/talk.git
synced 2026-07-09 13:09:30 +08:00
31 lines
681 B
JavaScript
31 lines
681 B
JavaScript
import React from 'react';
|
|
const PropTypes = require('prop-types');
|
|
import {ApolloProvider} from 'react-apollo';
|
|
|
|
class TalkProvider extends React.Component {
|
|
getChildContext() {
|
|
return {
|
|
eventEmitter: this.props.eventEmitter,
|
|
pym: this.props.pym,
|
|
plugins: this.props.plugins,
|
|
};
|
|
}
|
|
|
|
render() {
|
|
const {children, client, store, plugins} = this.props;
|
|
return (
|
|
<ApolloProvider client={client} store={store} plugins={plugins}>
|
|
{children}
|
|
</ApolloProvider>
|
|
);
|
|
}
|
|
}
|
|
|
|
TalkProvider.childContextTypes = {
|
|
pym: PropTypes.object,
|
|
eventEmitter: PropTypes.object,
|
|
plugins: PropTypes.array,
|
|
};
|
|
|
|
export default TalkProvider;
|