1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | 'use strict';
|
12 |
|
13 | var React = require('react');
|
14 |
|
15 | var ReactRelayContext = require('react-relay/ReactRelayContext');
|
16 |
|
17 | var useMemo = React.useMemo;
|
18 |
|
19 | function RelayEnvironmentProvider(props) {
|
20 | var children = props.children,
|
21 | environment = props.environment;
|
22 | var context = useMemo(function () {
|
23 | return {
|
24 | environment: environment
|
25 | };
|
26 | }, [environment]);
|
27 | return React.createElement(ReactRelayContext.Provider, {
|
28 | value: context
|
29 | }, children);
|
30 | }
|
31 |
|
32 | module.exports = RelayEnvironmentProvider; |
\ | No newline at end of file |