1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | 'use strict';
|
12 |
|
13 | var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
14 | var ReactDefaultInjection = require('./ReactDefaultInjection');
|
15 | var ReactMount = require('./ReactMount');
|
16 | var ReactReconciler = require('./ReactReconciler');
|
17 | var ReactUpdates = require('./ReactUpdates');
|
18 | var ReactVersion = require('./ReactVersion');
|
19 |
|
20 | var findDOMNode = require('./findDOMNode');
|
21 | var getHostComponentFromComposite = require('./getHostComponentFromComposite');
|
22 | var renderSubtreeIntoContainer = require('./renderSubtreeIntoContainer');
|
23 | var warning = require('fbjs/lib/warning');
|
24 |
|
25 | ReactDefaultInjection.inject();
|
26 |
|
27 | var ReactDOM = {
|
28 | findDOMNode: findDOMNode,
|
29 | render: ReactMount.render,
|
30 | unmountComponentAtNode: ReactMount.unmountComponentAtNode,
|
31 | version: ReactVersion,
|
32 |
|
33 |
|
34 | unstable_batchedUpdates: ReactUpdates.batchedUpdates,
|
35 | unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
|
36 |
|
37 | };
|
38 |
|
39 |
|
40 |
|
41 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
|
42 | __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
|
43 | ComponentTree: {
|
44 | getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
|
45 | getNodeFromInstance: function (inst) {
|
46 |
|
47 | if (inst._renderedComponent) {
|
48 | inst = getHostComponentFromComposite(inst);
|
49 | }
|
50 | if (inst) {
|
51 | return ReactDOMComponentTree.getNodeFromInstance(inst);
|
52 | } else {
|
53 | return null;
|
54 | }
|
55 | }
|
56 | },
|
57 | Mount: ReactMount,
|
58 | Reconciler: ReactReconciler
|
59 | });
|
60 | }
|
61 |
|
62 | if (process.env.NODE_ENV !== 'production') {
|
63 | var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
64 | if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
|
65 |
|
66 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
|
67 |
|
68 | if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
|
69 |
|
70 | var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
|
71 | 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');
|
72 | }
|
73 | }
|
74 |
|
75 | var testFunc = function testFn() {};
|
76 | 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;
|
77 |
|
78 |
|
79 |
|
80 | var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
|
81 |
|
82 | 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;
|
83 |
|
84 | var expectedFeatures = [
|
85 |
|
86 | Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim];
|
87 |
|
88 | for (var i = 0; i < expectedFeatures.length; i++) {
|
89 | if (!expectedFeatures[i]) {
|
90 | 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;
|
91 | break;
|
92 | }
|
93 | }
|
94 | }
|
95 | }
|
96 |
|
97 | if (process.env.NODE_ENV !== 'production') {
|
98 | var ReactInstrumentation = require('./ReactInstrumentation');
|
99 | var ReactDOMUnknownPropertyHook = require('./ReactDOMUnknownPropertyHook');
|
100 | var ReactDOMNullInputValuePropHook = require('./ReactDOMNullInputValuePropHook');
|
101 | var ReactDOMInvalidARIAHook = require('./ReactDOMInvalidARIAHook');
|
102 |
|
103 | ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
|
104 | ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
|
105 | ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook);
|
106 | }
|
107 |
|
108 | module.exports = ReactDOM; |
\ | No newline at end of file |