UNPKG

738 BJavaScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @emails oncall+relay
8 *
9 * @format
10 */
11'use strict';
12
13var React = require('react');
14
15var ReactRelayContext = require('react-relay/ReactRelayContext');
16
17var useMemo = React.useMemo;
18
19function 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
32module.exports = RelayEnvironmentProvider;
\No newline at end of file