react 0.14.0-alpha3 → 0.14.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/addons.js +2 -2
- package/dist/JSXTransformer.js +69 -70
- package/dist/react-with-addons.js +2047 -2078
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +1861 -1904
- package/dist/react.min.js +5 -5
- package/lib/{AutoFocusMixin.js → AutoFocusUtils.js} +13 -3
- package/lib/ChangeEventPlugin.js +4 -2
- package/lib/DOMProperty.js +81 -116
- package/lib/DOMPropertyOperations.js +70 -25
- package/lib/EnterLeaveEventPlugin.js +3 -3
- package/lib/EventPluginHub.js +2 -2
- package/lib/EventPluginUtils.js +6 -6
- package/lib/HTMLDOMPropertyConfig.js +8 -1
- package/lib/LinkedValueUtils.js +45 -33
- package/lib/PooledClass.js +12 -0
- package/lib/React.js +1 -1
- package/lib/ReactCSSTransitionGroupChild.js +8 -0
- package/lib/ReactChildren.js +3 -3
- package/lib/ReactClass.js +29 -47
- package/lib/ReactComponent.js +11 -6
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +45 -72
- package/lib/ReactDOM.js +1 -0
- package/lib/ReactDOMButton.js +15 -26
- package/lib/ReactDOMClient.js +9 -4
- package/lib/ReactDOMComponent.js +302 -24
- package/lib/ReactDOMIDOperations.js +14 -0
- package/lib/ReactDOMInput.js +78 -94
- package/lib/ReactDOMOption.js +19 -38
- package/lib/ReactDOMSelect.js +85 -95
- package/lib/ReactDOMTextarea.js +39 -52
- package/lib/ReactDefaultInjection.js +0 -47
- package/lib/ReactElement.js +18 -79
- package/lib/ReactElementValidator.js +29 -98
- package/lib/ReactErrorUtils.js +1 -1
- package/lib/ReactEventEmitterMixin.js +2 -3
- package/lib/ReactEventListener.js +43 -3
- package/lib/ReactFragment.js +12 -7
- package/lib/ReactInputSelection.js +4 -3
- package/lib/ReactInstanceHandles.js +3 -2
- package/lib/ReactMount.js +20 -40
- package/lib/ReactNativeComponent.js +0 -5
- package/lib/ReactNoopUpdateQueue.js +118 -0
- package/lib/ReactPropTypes.js +3 -3
- package/lib/ReactReconcileTransaction.js +2 -2
- package/lib/ReactReconciler.js +8 -10
- package/lib/ReactServerBatchingStrategy.js +23 -0
- package/lib/ReactServerRendering.js +13 -0
- package/lib/ReactServerRenderingTransaction.js +2 -2
- package/lib/ReactTestUtils.js +56 -33
- package/lib/ReactUpdateQueue.js +51 -26
- package/lib/ReactUpdates.js +0 -3
- package/lib/ReactWithAddons.js +0 -2
- package/lib/SelectEventPlugin.js +6 -7
- package/lib/SimpleEventPlugin.js +4 -4
- package/lib/SyntheticClipboardEvent.js +2 -2
- package/lib/SyntheticCompositionEvent.js +2 -2
- package/lib/SyntheticDragEvent.js +2 -2
- package/lib/SyntheticEvent.js +6 -5
- package/lib/SyntheticFocusEvent.js +2 -2
- package/lib/SyntheticInputEvent.js +2 -2
- package/lib/SyntheticKeyboardEvent.js +2 -2
- package/lib/SyntheticMouseEvent.js +2 -2
- package/lib/SyntheticTouchEvent.js +2 -2
- package/lib/SyntheticUIEvent.js +2 -2
- package/lib/SyntheticWheelEvent.js +2 -2
- package/lib/Transaction.js +10 -4
- package/lib/cloneWithProps.js +1 -1
- package/lib/deprecated.js +47 -0
- package/lib/findDOMNode.js +2 -3
- package/lib/forEachAccumulated.js +1 -1
- package/lib/getEventCharCode.js +1 -1
- package/lib/getEventModifierState.js +0 -1
- package/lib/getMarkupWrap.js +13 -35
- package/lib/instantiateReactComponent.js +13 -9
- package/lib/isTextInputElement.js +2 -1
- package/lib/joinClasses.js +1 -1
- package/lib/setInnerHTML.js +1 -1
- package/lib/traverseAllChildren.js +1 -1
- package/lib/warning.js +0 -4
- package/package.json +1 -1
- package/react.js +53 -1
- package/addons/CSSTransitionGroup.js +0 -1
- package/addons/LinkedStateMixin.js +0 -1
- package/addons/Perf.js +0 -1
- package/addons/PureRenderMixin.js +0 -1
- package/addons/TestUtils.js +0 -1
- package/addons/TransitionGroup.js +0 -1
- package/addons/batchedUpdates.js +0 -1
- package/addons/cloneWithProps.js +0 -1
- package/addons/createFragment.js +0 -1
- package/addons/renderSubtreeIntoContainer.js +0 -1
- package/addons/shallowCompare.js +0 -1
- package/addons/update.js +0 -1
- package/lib/LocalEventTrapMixin.js +0 -46
- package/lib/ReactContext.js +0 -32
- package/lib/ReactDOMForm.js +0 -47
- package/lib/ReactDOMIframe.js +0 -43
- package/lib/ReactDOMImg.js +0 -44
- package/lib/ReactLifeCycle.js +0 -35
- package/lib/createFullPageComponent.js +0 -51
|
@@ -26,6 +26,16 @@ assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin,
|
|
|
26
26
|
_instantiateReactComponent: instantiateReactComponent
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
+
function getDeclarationErrorAddendum(owner) {
|
|
30
|
+
if (owner) {
|
|
31
|
+
var name = owner.getName();
|
|
32
|
+
if (name) {
|
|
33
|
+
return ' Check the render method of `' + name + '`.';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
|
|
29
39
|
/**
|
|
30
40
|
* Check if the type reference is a known internal type. I.e. not a user
|
|
31
41
|
* provided composite type.
|
|
@@ -41,11 +51,10 @@ function isInternalComponentType(type) {
|
|
|
41
51
|
* Given a ReactNode, create an instance that will actually be mounted.
|
|
42
52
|
*
|
|
43
53
|
* @param {ReactNode} node
|
|
44
|
-
* @param {*} parentCompositeType The composite type that resolved this.
|
|
45
54
|
* @return {object} A new instance of the element's constructor.
|
|
46
55
|
* @protected
|
|
47
56
|
*/
|
|
48
|
-
function instantiateReactComponent(node
|
|
57
|
+
function instantiateReactComponent(node) {
|
|
49
58
|
var instance;
|
|
50
59
|
|
|
51
60
|
if (node === null || node === false) {
|
|
@@ -54,16 +63,11 @@ function instantiateReactComponent(node, parentCompositeType) {
|
|
|
54
63
|
|
|
55
64
|
if (typeof node === 'object') {
|
|
56
65
|
var element = node;
|
|
57
|
-
|
|
58
|
-
'production' !== process.env.NODE_ENV ? warning(element && (typeof element.type === 'function' || typeof element.type === 'string'), 'Only functions or strings can be mounted as React components.') : undefined;
|
|
59
|
-
}
|
|
66
|
+
!(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : undefined;
|
|
60
67
|
|
|
61
68
|
// Special case string values
|
|
62
|
-
if (
|
|
63
|
-
// Avoid recursion if the wrapper renders itself.
|
|
69
|
+
if (typeof element.type === 'string') {
|
|
64
70
|
instance = ReactNativeComponent.createInternalComponent(element);
|
|
65
|
-
// All native components are currently wrapped in a composite so we're
|
|
66
|
-
// safe to assume that this is what we should instantiate.
|
|
67
71
|
} else if (isInternalComponentType(element.type)) {
|
|
68
72
|
// This is temporarily available for custom components that are not string
|
|
69
73
|
// represenations. I.e. ART. Once those are updated to use the string
|
|
@@ -33,7 +33,8 @@ var supportedInputTypes = {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
function isTextInputElement(elem) {
|
|
36
|
-
|
|
36
|
+
var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
|
37
|
+
return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
module.exports = isTextInputElement;
|
package/lib/joinClasses.js
CHANGED
package/lib/setInnerHTML.js
CHANGED
|
@@ -70,7 +70,7 @@ if (ExecutionEnvironment.canUseDOM) {
|
|
|
70
70
|
// in hopes that this is preserved even if "\uFEFF" is transformed to
|
|
71
71
|
// the actual Unicode character (by Babel, for example).
|
|
72
72
|
// https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
|
|
73
|
-
node.innerHTML = String.fromCharCode(
|
|
73
|
+
node.innerHTML = String.fromCharCode(0xFEFF) + html;
|
|
74
74
|
|
|
75
75
|
// deleteData leaves an empty `TextNode` which offsets the index of all
|
|
76
76
|
// children. Definitely want to avoid this.
|
|
@@ -60,7 +60,7 @@ function getComponentKey(component, index) {
|
|
|
60
60
|
/**
|
|
61
61
|
* Escape a component key so that it is safe to use in a reactid.
|
|
62
62
|
*
|
|
63
|
-
* @param {*}
|
|
63
|
+
* @param {*} text Component key to be escaped.
|
|
64
64
|
* @return {string} An escaped string.
|
|
65
65
|
*/
|
|
66
66
|
function escapeUserProvidedKey(text) {
|
package/lib/warning.js
CHANGED
|
@@ -32,10 +32,6 @@ if ('production' !== process.env.NODE_ENV) {
|
|
|
32
32
|
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
if (format.length < 10 || /^[s\W]*$/.test(format)) {
|
|
36
|
-
throw new Error('The warning format should be able to uniquely identify this ' + 'warning. Please, use a more descriptive format than: ' + format);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
35
|
if (format.indexOf('Failed Composite propType: ') === 0) {
|
|
40
36
|
return; // Ignore CompositeComponent proptype check.
|
|
41
37
|
}
|
package/package.json
CHANGED
package/react.js
CHANGED
|
@@ -1 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('./lib/React');
|
|
4
|
+
|
|
5
|
+
var assign = require('./lib/Object.assign');
|
|
6
|
+
var deprecated = require('./lib/deprecated');
|
|
7
|
+
|
|
8
|
+
// We want to warn once when any of these methods are used.
|
|
9
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
10
|
+
var deprecations = {
|
|
11
|
+
// ReactDOMClient
|
|
12
|
+
findDOMNode: deprecated(
|
|
13
|
+
'findDOMNode',
|
|
14
|
+
'react-dom',
|
|
15
|
+
React,
|
|
16
|
+
React.findDOMNode
|
|
17
|
+
),
|
|
18
|
+
render: deprecated(
|
|
19
|
+
'render',
|
|
20
|
+
'react-dom',
|
|
21
|
+
React,
|
|
22
|
+
React.render
|
|
23
|
+
),
|
|
24
|
+
unmountComponentAtNode: deprecated(
|
|
25
|
+
'unmountComponentAtNode',
|
|
26
|
+
'react-dom',
|
|
27
|
+
React,
|
|
28
|
+
React.unmountComponentAtNode
|
|
29
|
+
),
|
|
30
|
+
// ReactDOMServer
|
|
31
|
+
renderToString: deprecated(
|
|
32
|
+
'renderToString',
|
|
33
|
+
'react-dom/server',
|
|
34
|
+
React,
|
|
35
|
+
React.renderToString
|
|
36
|
+
),
|
|
37
|
+
renderToStaticMarkup: deprecated(
|
|
38
|
+
'renderToStaticMarkup',
|
|
39
|
+
'react-dom/server',
|
|
40
|
+
React,
|
|
41
|
+
React.renderToStaticMarkup
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
// Export a wrapped object. We'll use assign and take advantage of the fact
|
|
45
|
+
// that this will override the original methods in React.
|
|
46
|
+
module.exports = assign(
|
|
47
|
+
{},
|
|
48
|
+
React,
|
|
49
|
+
deprecations
|
|
50
|
+
);
|
|
51
|
+
} else {
|
|
52
|
+
module.exports = React;
|
|
53
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/ReactCSSTransitionGroup');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/LinkedStateMixin');
|
package/addons/Perf.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/ReactDefaultPerf');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/ReactComponentWithPureRenderMixin');
|
package/addons/TestUtils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/ReactTestUtils');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/ReactTransitionGroup');
|
package/addons/batchedUpdates.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/ReactUpdates').batchedUpdates;
|
package/addons/cloneWithProps.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/cloneWithProps');
|
package/addons/createFragment.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/ReactFragment').create;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/renderSubtreeIntoContainer');
|
package/addons/shallowCompare.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/shallowCompare');
|
package/addons/update.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../lib/update');
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2014-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 LocalEventTrapMixin
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
|
|
15
|
-
|
|
16
|
-
var accumulateInto = require("./accumulateInto");
|
|
17
|
-
var findDOMNode = require("./findDOMNode");
|
|
18
|
-
var forEachAccumulated = require("./forEachAccumulated");
|
|
19
|
-
var invariant = require("./invariant");
|
|
20
|
-
|
|
21
|
-
function remove(event) {
|
|
22
|
-
event.remove();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var LocalEventTrapMixin = {
|
|
26
|
-
trapBubbledEvent: function (topLevelType, handlerBaseName) {
|
|
27
|
-
!this.isMounted() ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Must be mounted to trap events') : invariant(false) : undefined;
|
|
28
|
-
// If a component renders to null or if another component fatals and causes
|
|
29
|
-
// the state of the tree to be corrupted, `node` here can be null.
|
|
30
|
-
var node = findDOMNode(this);
|
|
31
|
-
!node ? 'production' !== process.env.NODE_ENV ? invariant(false, 'LocalEventTrapMixin.trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : undefined;
|
|
32
|
-
var listener = ReactBrowserEventEmitter.trapBubbledEvent(topLevelType, handlerBaseName, node);
|
|
33
|
-
this._localEventListeners = accumulateInto(this._localEventListeners, listener);
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
// trapCapturedEvent would look nearly identical. We don't implement that
|
|
37
|
-
// method because it isn't currently needed.
|
|
38
|
-
|
|
39
|
-
componentWillUnmount: function () {
|
|
40
|
-
if (this._localEventListeners) {
|
|
41
|
-
forEachAccumulated(this._localEventListeners, remove);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
module.exports = LocalEventTrapMixin;
|
package/lib/ReactContext.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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 ReactContext
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var emptyObject = require("./emptyObject");
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Keeps track of the current context.
|
|
18
|
-
*
|
|
19
|
-
* The context is automatically passed down the component ownership hierarchy
|
|
20
|
-
* and is accessible via `this.context` on ReactCompositeComponents.
|
|
21
|
-
*/
|
|
22
|
-
var ReactContext = {
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @internal
|
|
26
|
-
* @type {object}
|
|
27
|
-
*/
|
|
28
|
-
current: emptyObject
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
module.exports = ReactContext;
|
package/lib/ReactDOMForm.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
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 ReactDOMForm
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var EventConstants = require("./EventConstants");
|
|
15
|
-
var LocalEventTrapMixin = require("./LocalEventTrapMixin");
|
|
16
|
-
var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
17
|
-
var ReactClass = require("./ReactClass");
|
|
18
|
-
var ReactElement = require("./ReactElement");
|
|
19
|
-
|
|
20
|
-
var form = ReactElement.createFactory('form');
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Since onSubmit doesn't bubble OR capture on the top level in IE8, we need
|
|
24
|
-
* to capture it on the <form> element itself. There are lots of hacks we could
|
|
25
|
-
* do to accomplish this, but the most reliable is to make <form> a
|
|
26
|
-
* composite component and use `componentDidMount` to attach the event handlers.
|
|
27
|
-
*/
|
|
28
|
-
var ReactDOMForm = ReactClass.createClass({
|
|
29
|
-
displayName: 'ReactDOMForm',
|
|
30
|
-
tagName: 'FORM',
|
|
31
|
-
|
|
32
|
-
mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
|
|
33
|
-
|
|
34
|
-
render: function () {
|
|
35
|
-
// TODO: Instead of using `ReactDOM` directly, we should use JSX. However,
|
|
36
|
-
// `jshint` fails to parse JSX so in order for linting to work in the open
|
|
37
|
-
// source repo, we need to just use `ReactDOM.form`.
|
|
38
|
-
return form(this.props);
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
componentDidMount: function () {
|
|
42
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset');
|
|
43
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit');
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
module.exports = ReactDOMForm;
|
package/lib/ReactDOMIframe.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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 ReactDOMIframe
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var EventConstants = require("./EventConstants");
|
|
15
|
-
var LocalEventTrapMixin = require("./LocalEventTrapMixin");
|
|
16
|
-
var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
17
|
-
var ReactClass = require("./ReactClass");
|
|
18
|
-
var ReactElement = require("./ReactElement");
|
|
19
|
-
|
|
20
|
-
var iframe = ReactElement.createFactory('iframe');
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Since onLoad doesn't bubble OR capture on the top level in IE8, we need to
|
|
24
|
-
* capture it on the <iframe> element itself. There are lots of hacks we could
|
|
25
|
-
* do to accomplish this, but the most reliable is to make <iframe> a composite
|
|
26
|
-
* component and use `componentDidMount` to attach the event handlers.
|
|
27
|
-
*/
|
|
28
|
-
var ReactDOMIframe = ReactClass.createClass({
|
|
29
|
-
displayName: 'ReactDOMIframe',
|
|
30
|
-
tagName: 'IFRAME',
|
|
31
|
-
|
|
32
|
-
mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
|
|
33
|
-
|
|
34
|
-
render: function () {
|
|
35
|
-
return iframe(this.props);
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
componentDidMount: function () {
|
|
39
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load');
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
module.exports = ReactDOMIframe;
|
package/lib/ReactDOMImg.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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 ReactDOMImg
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var EventConstants = require("./EventConstants");
|
|
15
|
-
var LocalEventTrapMixin = require("./LocalEventTrapMixin");
|
|
16
|
-
var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
17
|
-
var ReactClass = require("./ReactClass");
|
|
18
|
-
var ReactElement = require("./ReactElement");
|
|
19
|
-
|
|
20
|
-
var img = ReactElement.createFactory('img');
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Since onLoad doesn't bubble OR capture on the top level in IE8, we need to
|
|
24
|
-
* capture it on the <img> element itself. There are lots of hacks we could do
|
|
25
|
-
* to accomplish this, but the most reliable is to make <img> a composite
|
|
26
|
-
* component and use `componentDidMount` to attach the event handlers.
|
|
27
|
-
*/
|
|
28
|
-
var ReactDOMImg = ReactClass.createClass({
|
|
29
|
-
displayName: 'ReactDOMImg',
|
|
30
|
-
tagName: 'IMG',
|
|
31
|
-
|
|
32
|
-
mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
|
|
33
|
-
|
|
34
|
-
render: function () {
|
|
35
|
-
return img(this.props);
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
componentDidMount: function () {
|
|
39
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load');
|
|
40
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error');
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
module.exports = ReactDOMImg;
|
package/lib/ReactLifeCycle.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 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 ReactLifeCycle
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* This module manages the bookkeeping when a component is in the process
|
|
16
|
-
* of being mounted or being unmounted. This is used as a way to enforce
|
|
17
|
-
* invariants (or warnings) when it is not recommended to call
|
|
18
|
-
* setState/forceUpdate.
|
|
19
|
-
*
|
|
20
|
-
* currentlyMountingInstance: During the construction phase, it is not possible
|
|
21
|
-
* to trigger an update since the instance is not fully mounted yet. However, we
|
|
22
|
-
* currently allow this as a convenience for mutating the initial state.
|
|
23
|
-
*
|
|
24
|
-
* currentlyUnmountingInstance: During the unmounting phase, the instance is
|
|
25
|
-
* still mounted and can therefore schedule an update. However, this is not
|
|
26
|
-
* recommended and probably an error since it's about to be unmounted.
|
|
27
|
-
* Therefore we still want to trigger in an error for that case.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
var ReactLifeCycle = {
|
|
31
|
-
currentlyMountingInstance: null,
|
|
32
|
-
currentlyUnmountingInstance: null
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
module.exports = ReactLifeCycle;
|