Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80517 views
1
/**
2
* Copyright 2013-2015, Facebook, Inc.
3
* All rights reserved.
4
*
5
* This source code is licensed under the BSD-style license found in the
6
* LICENSE file in the root directory of this source tree. An additional grant
7
* of patent rights can be found in the PATENTS file in the same directory.
8
*
9
* @providesModule ReactComponentBrowserEnvironment
10
*/
11
12
/*jslint evil: true */
13
14
'use strict';
15
16
var ReactDOMIDOperations = require("./ReactDOMIDOperations");
17
var ReactMount = require("./ReactMount");
18
19
/**
20
* Abstracts away all functionality of the reconciler that requires knowledge of
21
* the browser context. TODO: These callers should be refactored to avoid the
22
* need for this injection.
23
*/
24
var ReactComponentBrowserEnvironment = {
25
26
processChildrenUpdates:
27
ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
28
29
replaceNodeWithMarkupByID:
30
ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID,
31
32
/**
33
* If a particular environment requires that some resources be cleaned up,
34
* specify this in the injected Mixin. In the DOM, we would likely want to
35
* purge any cached node ID lookups.
36
*
37
* @private
38
*/
39
unmountIDFromEnvironment: function(rootNodeID) {
40
ReactMount.purgeID(rootNodeID);
41
}
42
43
};
44
45
module.exports = ReactComponentBrowserEnvironment;
46
47