1 | import { invariant } from "../../utilities/globals/index.js";
|
2 | import * as React from 'react';
|
3 | import { getApolloContext } from "./ApolloContext.js";
|
4 | export var ApolloProvider = function (_a) {
|
5 | var client = _a.client, children = _a.children;
|
6 | var ApolloContext = getApolloContext();
|
7 | return (React.createElement(ApolloContext.Consumer, null, function (context) {
|
8 | if (context === void 0) { context = {}; }
|
9 | if (client && context.client !== client) {
|
10 | context = Object.assign({}, context, { client: client });
|
11 | }
|
12 | __DEV__ ? invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
|
13 | 'sure you pass in your client via the "client" prop.') : invariant(context.client, 29);
|
14 | return (React.createElement(ApolloContext.Provider, { value: context }, children));
|
15 | }));
|
16 | };
|
17 |
|
\ | No newline at end of file |