1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | 'use strict';
|
14 |
|
15 | var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
16 | var ReactDefaultInjection = require('./ReactDefaultInjection');
|
17 | var ReactMount = require('./ReactMount');
|
18 | var ReactReconciler = require('./ReactReconciler');
|
19 | var ReactUpdates = require('./ReactUpdates');
|
20 | var ReactVersion = require('./ReactVersion');
|
21 |
|
22 | var findDOMNode = require('./findDOMNode');
|
23 | var getHostComponentFromComposite = require('./getHostComponentFromComposite');
|
24 | var renderSubtreeIntoContainer = require('./renderSubtreeIntoContainer');
|
25 | var warning = require('fbjs/lib/warning');
|
26 |
|
27 | ReactDefaultInjection.inject();
|
28 |
|
29 | var ReactDOM = {
|
30 | findDOMNode: findDOMNode,
|
31 | render: ReactMount.render,
|
32 | unmountComponentAtNode: ReactMount.unmountComponentAtNode,
|
33 | version: ReactVersion,
|
34 |
|
35 |
|
36 | unstable_batchedUpdates: ReactUpdates.batchedUpdates,
|
37 | unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
|
38 |
|
39 | };
|
40 |
|
41 |
|
42 |
|
43 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
|
44 | __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
|
45 | ComponentTree: {
|
46 | getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
|
47 | getNodeFromInstance: function (inst) {
|
48 |
|
49 | if (inst._renderedComponent) {
|
50 | inst = getHostComponentFromComposite(inst);
|
51 | }
|
52 | if (inst) {
|
53 | return ReactDOMComponentTree.getNodeFromInstance(inst);
|
54 | } else {
|
55 | return null;
|
56 | }
|
57 | }
|
58 | },
|
59 | Mount: ReactMount,
|
60 | Reconciler: ReactReconciler
|
61 | });
|
62 | }
|
63 |
|
64 | if (process.env.NODE_ENV !== 'production') {
|
65 | var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
66 | if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
|
67 |
|
68 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
|
69 |
|
70 | if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
|
71 |
|
72 | var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
|
73 | console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
|
74 | }
|
75 | }
|
76 |
|
77 | var testFunc = function testFn() {};
|
78 | process.env.NODE_ENV !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, "It looks like you're using a minified copy of the development build " + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
|
79 |
|
80 |
|
81 |
|
82 | var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
|
83 |
|
84 | process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
|
85 |
|
86 | var expectedFeatures = [
|
87 |
|
88 | Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim];
|
89 |
|
90 | for (var i = 0; i < expectedFeatures.length; i++) {
|
91 | if (!expectedFeatures[i]) {
|
92 | process.env.NODE_ENV !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
|
93 | break;
|
94 | }
|
95 | }
|
96 | }
|
97 | }
|
98 |
|
99 | if (process.env.NODE_ENV !== 'production') {
|
100 | var ReactInstrumentation = require('./ReactInstrumentation');
|
101 | var ReactDOMUnknownPropertyHook = require('./ReactDOMUnknownPropertyHook');
|
102 | var ReactDOMNullInputValuePropHook = require('./ReactDOMNullInputValuePropHook');
|
103 | var ReactDOMInvalidARIAHook = require('./ReactDOMInvalidARIAHook');
|
104 |
|
105 | ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
|
106 | ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
|
107 | ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook);
|
108 | }
|
109 |
|
110 | module.exports = ReactDOM; |
\ | No newline at end of file |