UNPKG

1.18 kBJavaScriptView Raw
1/**
2 * Copyright (c) 2014-present, Facebook, Inc.
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 */
9
10'use strict';
11
12var _prodInvariant = require('./reactProdInvariant');
13
14var invariant = require('fbjs/lib/invariant');
15
16var injected = false;
17
18var ReactComponentEnvironment = {
19 /**
20 * Optionally injectable hook for swapping out mount images in the middle of
21 * the tree.
22 */
23 replaceNodeWithMarkup: null,
24
25 /**
26 * Optionally injectable hook for processing a queue of child updates. Will
27 * later move into MultiChildComponents.
28 */
29 processChildrenUpdates: null,
30
31 injection: {
32 injectEnvironment: function (environment) {
33 !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
34 ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
35 ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
36 injected = true;
37 }
38 }
39};
40
41module.exports = ReactComponentEnvironment;
\No newline at end of file