UNPKG

898 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 *
8 * @format
9 */
10// flowlint ambiguous-object-type:error
11'use strict';
12
13var React = require('react');
14
15var _React$__SECRET_INTER =
16/* $FlowFixMe[prop-missing] Flow doesn't know about React's internals for
17 * good reason, but for now, Relay needs the dispatcher to read context. */
18React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
19 ReactCurrentDispatcher = _React$__SECRET_INTER.ReactCurrentDispatcher,
20 ReactCurrentOwner = _React$__SECRET_INTER.ReactCurrentOwner;
21
22function readContext(Context) {
23 var dispatcher = ReactCurrentDispatcher != null ? ReactCurrentDispatcher.current : ReactCurrentOwner.currentDispatcher;
24 return dispatcher.readContext(Context);
25}
26
27module.exports = readContext;
\No newline at end of file