Add child context types to Compat container
'use strict';
const ReactRelayPaginationContainer = require('ReactRelayPaginationContainer');
+const RelayPropTypes = require('RelayPropTypes');
const {buildCompatContainer} = require('ReactRelayCompatContainerBuilder');
@@ -33,7 +34,7 @@ function createContainer<TBase: ReactClass<*>>(
fragmentSpec: GraphQLTaggedNode | GeneratedNodeMap,
connectionConfig: ConnectionConfig,
): TBase {
- return buildCompatContainer(
+ const Container = buildCompatContainer(
Component,
(fragmentSpec: any),
(ComponentClass, fragments) => {
@@ -44,6 +45,10 @@ function createContainer<TBase: ReactClass<*>>(
);
},
);
+ Container.childContextTypes = {
+ relay: RelayPropTypes.Relay,
+ };
+ return Container;
}
module.exports = {createContainer};
