1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | 'use strict';
|
12 |
|
13 | var ReactRelayContext = require('react-relay/ReactRelayContext');
|
14 |
|
15 | var invariant = require("fbjs/lib/invariant");
|
16 |
|
17 | var _require = require('react'),
|
18 | useContext = _require.useContext;
|
19 |
|
20 | function useRelayEnvironment() {
|
21 | var context = useContext(ReactRelayContext);
|
22 | !(context != null) ? process.env.NODE_ENV !== "production" ? invariant(false, 'useRelayEnvironment: Expected to have found a Relay environment provided by ' + 'a `RelayEnvironmentProvider` component. ' + 'This usually means that useRelayEnvironment was used in a ' + 'component that is not a descendant of a `RelayEnvironmentProvider`. ' + 'Please make sure a `RelayEnvironmentProvider` has been rendered somewhere ' + 'as a parent of ancestor your compontent.') : invariant(false) : void 0;
|
23 | return context.environment;
|
24 | }
|
25 |
|
26 | module.exports = useRelayEnvironment; |
\ | No newline at end of file |