react 15.0.0-rc.1 → 15.0.2-alpha.1
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/dist/react-with-addons.js +1446 -1195
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +1330 -1109
- package/dist/react.min.js +6 -6
- package/lib/CSSProperty.js +6 -0
- package/lib/CSSPropertyOperations.js +31 -15
- package/lib/CallbackQueue.js +3 -2
- package/lib/DOMChildrenOperations.js +0 -3
- package/lib/DOMLazyTree.js +11 -2
- package/lib/DOMPropertyOperations.js +0 -46
- package/lib/EventPluginUtils.js +2 -2
- package/lib/FallbackCompositionState.js +3 -2
- package/lib/HTMLDOMPropertyConfig.js +111 -111
- package/lib/IOSDefaultEventPluginOrder.js +16 -0
- package/lib/IOSNativeBridgeEventPlugin.js +57 -0
- package/lib/NativeMethodsMixin.js +165 -0
- package/lib/OrderedMap.js +3 -2
- package/lib/PanResponder.js +362 -0
- package/lib/React.js +68 -9
- package/lib/ReactBrowserEventEmitter.js +3 -2
- package/lib/ReactCSSTransitionGroup.js +3 -3
- package/lib/ReactClass.js +7 -6
- package/lib/ReactComponent.js +2 -2
- package/lib/ReactCompositeComponent.js +5 -4
- package/lib/ReactDOMComponent.js +14 -15
- package/lib/ReactDOMDebugTool.js +0 -8
- package/lib/ReactDOMEmptyComponent.js +3 -3
- package/lib/ReactDOMInput.js +5 -4
- package/lib/ReactDOMOption.js +13 -2
- package/lib/ReactDOMSelect.js +3 -2
- package/lib/ReactDOMTextComponent.js +3 -2
- package/lib/ReactDOMTextarea.js +3 -2
- package/lib/ReactDebugInstanceMap.js +102 -0
- package/lib/ReactDefaultBatchingStrategy.js +3 -2
- package/lib/ReactDefaultPerf.js +46 -7
- package/lib/ReactDefaultPerfAnalysis.js +7 -7
- package/lib/ReactElement.js +5 -4
- package/lib/ReactEventListener.js +3 -2
- package/lib/ReactMarkupChecksum.js +7 -2
- package/lib/ReactMount.js +1 -0
- package/lib/ReactNative.js +71 -0
- package/lib/ReactNativeAttributePayload.js +397 -0
- package/lib/ReactNativeBaseComponent.js +196 -0
- package/lib/ReactNativeComponent.js +3 -2
- package/lib/ReactNativeComponentEnvironment.js +38 -0
- package/lib/ReactNativeComponentTree.js +66 -0
- package/lib/ReactNativeContainerInfo.js +21 -0
- package/lib/ReactNativeDOMIDOperations.js +83 -0
- package/lib/ReactNativeDefaultInjection.js +99 -0
- package/lib/ReactNativeEventEmitter.js +180 -0
- package/lib/ReactNativeGlobalInteractionHandler.js +33 -0
- package/lib/ReactNativeGlobalResponderHandler.js +25 -0
- package/lib/ReactNativeMount.js +190 -0
- package/lib/ReactNativePropRegistry.js +52 -0
- package/lib/ReactNativeReconcileTransaction.js +100 -0
- package/lib/ReactNativeTagHandles.js +54 -0
- package/lib/ReactNativeTextComponent.js +70 -0
- package/lib/ReactNativeTreeTraversal.js +127 -0
- package/lib/ReactOwner.js +4 -3
- package/lib/ReactPropTransferer.js +4 -3
- package/lib/ReactReconcileTransaction.js +3 -3
- package/lib/ReactServerRenderingTransaction.js +3 -3
- package/lib/ReactSimpleEmptyComponent.js +3 -3
- package/lib/ReactTestUtils.js +14 -4
- package/lib/ReactTransitionGroup.js +3 -2
- package/lib/ReactUMDEntry.js +26 -0
- package/lib/ReactUpdateQueue.js +20 -3
- package/lib/ReactUpdates.js +3 -2
- package/lib/ReactVersion.js +1 -1
- package/lib/ReactWithAddons.js +0 -7
- package/lib/ReactWithAddonsUMDEntry.js +26 -0
- package/lib/ResponderSyntheticEvent.js +1 -1
- package/lib/SVGDOMPropertyConfig.js +266 -52
- package/lib/SyntheticEvent.js +5 -4
- package/lib/TouchHistoryMath.js +99 -0
- package/lib/createReactNativeComponentClass.js +42 -0
- package/lib/deprecated.js +3 -2
- package/lib/findNodeHandle.js +89 -0
- package/lib/instantiateReactComponent.js +3 -2
- package/lib/reactComponentExpect.js +3 -2
- package/lib/setInnerHTML.js +1 -0
- package/lib/update.js +4 -3
- package/lib/validateDOMNesting.js +3 -2
- package/package.json +5 -4
- package/addons.js +0 -15
- package/lib/Object.assign.js +0 -47
- package/lib/React.native.js +0 -5
- package/lib/ReactDOM.native.js +0 -12
- package/lib/ReactDOMSVGDeprecatedAttributeDevtool.js +0 -61
- package/lib/ReactIsomorphic.js +0 -74
package/lib/React.js
CHANGED
|
@@ -11,18 +11,77 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
var ReactDOMServer = require('./ReactDOMServer');
|
|
16
|
-
var ReactIsomorphic = require('./ReactIsomorphic');
|
|
14
|
+
var _assign = require('object-assign');
|
|
17
15
|
|
|
18
|
-
var
|
|
16
|
+
var ReactChildren = require('./ReactChildren');
|
|
17
|
+
var ReactComponent = require('./ReactComponent');
|
|
18
|
+
var ReactClass = require('./ReactClass');
|
|
19
|
+
var ReactDOMFactories = require('./ReactDOMFactories');
|
|
20
|
+
var ReactElement = require('./ReactElement');
|
|
21
|
+
var ReactElementValidator = require('./ReactElementValidator');
|
|
22
|
+
var ReactPropTypes = require('./ReactPropTypes');
|
|
23
|
+
var ReactVersion = require('./ReactVersion');
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
var
|
|
25
|
+
var onlyChild = require('./onlyChild');
|
|
26
|
+
var warning = require('fbjs/lib/warning');
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
var createElement = ReactElement.createElement;
|
|
29
|
+
var createFactory = ReactElement.createFactory;
|
|
30
|
+
var cloneElement = ReactElement.cloneElement;
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
33
|
+
createElement = ReactElementValidator.createElement;
|
|
34
|
+
createFactory = ReactElementValidator.createFactory;
|
|
35
|
+
cloneElement = ReactElementValidator.cloneElement;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var __spread = _assign;
|
|
39
|
+
|
|
40
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
41
|
+
var warned = false;
|
|
42
|
+
__spread = function () {
|
|
43
|
+
process.env.NODE_ENV !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
|
|
44
|
+
warned = true;
|
|
45
|
+
return _assign.apply(null, arguments);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var React = {
|
|
50
|
+
|
|
51
|
+
// Modern
|
|
52
|
+
|
|
53
|
+
Children: {
|
|
54
|
+
map: ReactChildren.map,
|
|
55
|
+
forEach: ReactChildren.forEach,
|
|
56
|
+
count: ReactChildren.count,
|
|
57
|
+
toArray: ReactChildren.toArray,
|
|
58
|
+
only: onlyChild
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
Component: ReactComponent,
|
|
62
|
+
|
|
63
|
+
createElement: createElement,
|
|
64
|
+
cloneElement: cloneElement,
|
|
65
|
+
isValidElement: ReactElement.isValidElement,
|
|
66
|
+
|
|
67
|
+
// Classic
|
|
68
|
+
|
|
69
|
+
PropTypes: ReactPropTypes,
|
|
70
|
+
createClass: ReactClass.createClass,
|
|
71
|
+
createFactory: createFactory,
|
|
72
|
+
createMixin: function (mixin) {
|
|
73
|
+
// Currently a noop. Will be used to validate and trace mixins.
|
|
74
|
+
return mixin;
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
// This looks DOM specific but these are actually isomorphic helpers
|
|
78
|
+
// since they are just generating DOM strings.
|
|
79
|
+
DOM: ReactDOMFactories,
|
|
80
|
+
|
|
81
|
+
version: ReactVersion,
|
|
82
|
+
|
|
83
|
+
// Deprecated hook for JSX spread, don't use this for anything.
|
|
84
|
+
__spread: __spread
|
|
85
|
+
};
|
|
27
86
|
|
|
28
87
|
module.exports = React;
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var EventConstants = require('./EventConstants');
|
|
15
17
|
var EventPluginRegistry = require('./EventPluginRegistry');
|
|
16
18
|
var ReactEventEmitterMixin = require('./ReactEventEmitterMixin');
|
|
17
19
|
var ViewportMetrics = require('./ViewportMetrics');
|
|
18
20
|
|
|
19
|
-
var assign = require('./Object.assign');
|
|
20
21
|
var getVendorPrefixedEventName = require('./getVendorPrefixedEventName');
|
|
21
22
|
var isEventSupported = require('./isEventSupported');
|
|
22
23
|
|
|
@@ -175,7 +176,7 @@ function getListeningForDocument(mountAt) {
|
|
|
175
176
|
*
|
|
176
177
|
* @internal
|
|
177
178
|
*/
|
|
178
|
-
var ReactBrowserEventEmitter =
|
|
179
|
+
var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
|
|
179
180
|
|
|
180
181
|
/**
|
|
181
182
|
* Injectable event backend
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var React = require('./React');
|
|
17
17
|
|
|
18
18
|
var ReactTransitionGroup = require('./ReactTransitionGroup');
|
|
19
19
|
var ReactCSSTransitionGroupChild = require('./ReactCSSTransitionGroupChild');
|
|
@@ -75,7 +75,7 @@ var ReactCSSTransitionGroup = React.createClass({
|
|
|
75
75
|
},
|
|
76
76
|
|
|
77
77
|
render: function () {
|
|
78
|
-
return React.createElement(ReactTransitionGroup,
|
|
78
|
+
return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
|
package/lib/ReactClass.js
CHANGED
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var ReactComponent = require('./ReactComponent');
|
|
15
17
|
var ReactElement = require('./ReactElement');
|
|
16
18
|
var ReactPropTypeLocations = require('./ReactPropTypeLocations');
|
|
17
19
|
var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');
|
|
18
20
|
var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue');
|
|
19
21
|
|
|
20
|
-
var assign = require('./Object.assign');
|
|
21
22
|
var emptyObject = require('fbjs/lib/emptyObject');
|
|
22
23
|
var invariant = require('fbjs/lib/invariant');
|
|
23
24
|
var keyMirror = require('fbjs/lib/keyMirror');
|
|
@@ -322,13 +323,13 @@ var RESERVED_SPEC_KEYS = {
|
|
|
322
323
|
if (process.env.NODE_ENV !== 'production') {
|
|
323
324
|
validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
|
|
324
325
|
}
|
|
325
|
-
Constructor.childContextTypes =
|
|
326
|
+
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
|
|
326
327
|
},
|
|
327
328
|
contextTypes: function (Constructor, contextTypes) {
|
|
328
329
|
if (process.env.NODE_ENV !== 'production') {
|
|
329
330
|
validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
|
|
330
331
|
}
|
|
331
|
-
Constructor.contextTypes =
|
|
332
|
+
Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
|
|
332
333
|
},
|
|
333
334
|
/**
|
|
334
335
|
* Special case getDefaultProps which should move into statics but requires
|
|
@@ -345,7 +346,7 @@ var RESERVED_SPEC_KEYS = {
|
|
|
345
346
|
if (process.env.NODE_ENV !== 'production') {
|
|
346
347
|
validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
|
|
347
348
|
}
|
|
348
|
-
Constructor.propTypes =
|
|
349
|
+
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
|
|
349
350
|
},
|
|
350
351
|
statics: function (Constructor, statics) {
|
|
351
352
|
mixStaticSpecIntoComponent(Constructor, statics);
|
|
@@ -599,7 +600,7 @@ var ReactClassMixin = {
|
|
|
599
600
|
replaceState: function (newState, callback) {
|
|
600
601
|
this.updater.enqueueReplaceState(this, newState);
|
|
601
602
|
if (callback) {
|
|
602
|
-
this.updater.enqueueCallback(this, callback);
|
|
603
|
+
this.updater.enqueueCallback(this, callback, 'replaceState');
|
|
603
604
|
}
|
|
604
605
|
},
|
|
605
606
|
|
|
@@ -615,7 +616,7 @@ var ReactClassMixin = {
|
|
|
615
616
|
};
|
|
616
617
|
|
|
617
618
|
var ReactClassComponent = function () {};
|
|
618
|
-
|
|
619
|
+
_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
|
|
619
620
|
|
|
620
621
|
/**
|
|
621
622
|
* Module for creating composite components.
|
package/lib/ReactComponent.js
CHANGED
|
@@ -66,7 +66,7 @@ ReactComponent.prototype.setState = function (partialState, callback) {
|
|
|
66
66
|
}
|
|
67
67
|
this.updater.enqueueSetState(this, partialState);
|
|
68
68
|
if (callback) {
|
|
69
|
-
this.updater.enqueueCallback(this, callback);
|
|
69
|
+
this.updater.enqueueCallback(this, callback, 'setState');
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
|
|
@@ -87,7 +87,7 @@ ReactComponent.prototype.setState = function (partialState, callback) {
|
|
|
87
87
|
ReactComponent.prototype.forceUpdate = function (callback) {
|
|
88
88
|
this.updater.enqueueForceUpdate(this);
|
|
89
89
|
if (callback) {
|
|
90
|
-
this.updater.enqueueCallback(this, callback);
|
|
90
|
+
this.updater.enqueueCallback(this, callback, 'forceUpdate');
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var ReactComponentEnvironment = require('./ReactComponentEnvironment');
|
|
15
17
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
16
18
|
var ReactElement = require('./ReactElement');
|
|
@@ -24,7 +26,6 @@ var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');
|
|
|
24
26
|
var ReactReconciler = require('./ReactReconciler');
|
|
25
27
|
var ReactUpdateQueue = require('./ReactUpdateQueue');
|
|
26
28
|
|
|
27
|
-
var assign = require('./Object.assign');
|
|
28
29
|
var emptyObject = require('fbjs/lib/emptyObject');
|
|
29
30
|
var invariant = require('fbjs/lib/invariant');
|
|
30
31
|
var shouldUpdateReactComponent = require('./shouldUpdateReactComponent');
|
|
@@ -413,7 +414,7 @@ var ReactCompositeComponentMixin = {
|
|
|
413
414
|
for (var name in childContext) {
|
|
414
415
|
!(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : void 0;
|
|
415
416
|
}
|
|
416
|
-
return
|
|
417
|
+
return _assign({}, currentContext, childContext);
|
|
417
418
|
}
|
|
418
419
|
return currentContext;
|
|
419
420
|
},
|
|
@@ -587,10 +588,10 @@ var ReactCompositeComponentMixin = {
|
|
|
587
588
|
return queue[0];
|
|
588
589
|
}
|
|
589
590
|
|
|
590
|
-
var nextState =
|
|
591
|
+
var nextState = _assign({}, replace ? queue[0] : inst.state);
|
|
591
592
|
for (var i = replace ? 1 : 0; i < queue.length; i++) {
|
|
592
593
|
var partial = queue[i];
|
|
593
|
-
|
|
594
|
+
_assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
|
|
594
595
|
}
|
|
595
596
|
|
|
596
597
|
return nextState;
|
package/lib/ReactDOMComponent.js
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
|
+
var _assign = require('object-assign');
|
|
17
|
+
|
|
16
18
|
var AutoFocusUtils = require('./AutoFocusUtils');
|
|
17
19
|
var CSSPropertyOperations = require('./CSSPropertyOperations');
|
|
18
20
|
var DOMLazyTree = require('./DOMLazyTree');
|
|
@@ -34,7 +36,6 @@ var ReactDOMTextarea = require('./ReactDOMTextarea');
|
|
|
34
36
|
var ReactMultiChild = require('./ReactMultiChild');
|
|
35
37
|
var ReactPerf = require('./ReactPerf');
|
|
36
38
|
|
|
37
|
-
var assign = require('./Object.assign');
|
|
38
39
|
var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
|
|
39
40
|
var invariant = require('fbjs/lib/invariant');
|
|
40
41
|
var isEventSupported = require('./isEventSupported');
|
|
@@ -144,6 +145,7 @@ function assertValidProps(component, props) {
|
|
|
144
145
|
if (process.env.NODE_ENV !== 'production') {
|
|
145
146
|
process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
|
|
146
147
|
process.env.NODE_ENV !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
|
|
148
|
+
process.env.NODE_ENV !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
|
|
147
149
|
}
|
|
148
150
|
!(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : void 0;
|
|
149
151
|
}
|
|
@@ -173,6 +175,11 @@ function putListener() {
|
|
|
173
175
|
EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
|
|
174
176
|
}
|
|
175
177
|
|
|
178
|
+
function optionPostMount() {
|
|
179
|
+
var inst = this;
|
|
180
|
+
ReactDOMOption.postMountWrapper(inst);
|
|
181
|
+
}
|
|
182
|
+
|
|
176
183
|
// There are so many media events, it makes sense to just
|
|
177
184
|
// maintain a list rather than create a `trapBubbledEvent` for each
|
|
178
185
|
var mediaEvents = {
|
|
@@ -275,7 +282,7 @@ var newlineEatingTags = {
|
|
|
275
282
|
// For HTML, certain tags cannot have children. This has the same purpose as
|
|
276
283
|
// `omittedCloseTags` except that `menuitem` should still have its closing tag.
|
|
277
284
|
|
|
278
|
-
var voidElementTags =
|
|
285
|
+
var voidElementTags = _assign({
|
|
279
286
|
'menuitem': true
|
|
280
287
|
}, omittedCloseTags);
|
|
281
288
|
|
|
@@ -481,6 +488,8 @@ ReactDOMComponent.Mixin = {
|
|
|
481
488
|
transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
|
|
482
489
|
}
|
|
483
490
|
break;
|
|
491
|
+
case 'option':
|
|
492
|
+
transaction.getReactMountReady().enqueue(optionPostMount, this);
|
|
484
493
|
}
|
|
485
494
|
|
|
486
495
|
return mountImage;
|
|
@@ -521,7 +530,7 @@ ReactDOMComponent.Mixin = {
|
|
|
521
530
|
// See `_updateDOMProperties`. style block
|
|
522
531
|
this._previousStyle = propValue;
|
|
523
532
|
}
|
|
524
|
-
propValue = this._previousStyleCopy =
|
|
533
|
+
propValue = this._previousStyleCopy = _assign({}, props.style);
|
|
525
534
|
}
|
|
526
535
|
propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
|
|
527
536
|
}
|
|
@@ -530,10 +539,6 @@ ReactDOMComponent.Mixin = {
|
|
|
530
539
|
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
|
531
540
|
markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
|
|
532
541
|
}
|
|
533
|
-
} else if (this._namespaceURI === DOMNamespaces.svg) {
|
|
534
|
-
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
|
535
|
-
markup = DOMPropertyOperations.createMarkupForSVGAttribute(propKey, propValue);
|
|
536
|
-
}
|
|
537
542
|
} else {
|
|
538
543
|
markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
|
|
539
544
|
}
|
|
@@ -728,8 +733,6 @@ ReactDOMComponent.Mixin = {
|
|
|
728
733
|
// listener (e.g., onClick={null})
|
|
729
734
|
deleteListener(this, propKey);
|
|
730
735
|
}
|
|
731
|
-
} else if (this._namespaceURI === DOMNamespaces.svg) {
|
|
732
|
-
DOMPropertyOperations.deleteValueForSVGAttribute(getNode(this), propKey);
|
|
733
736
|
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
|
734
737
|
DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
|
|
735
738
|
}
|
|
@@ -746,7 +749,7 @@ ReactDOMComponent.Mixin = {
|
|
|
746
749
|
checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
|
|
747
750
|
this._previousStyle = nextProp;
|
|
748
751
|
}
|
|
749
|
-
nextProp = this._previousStyleCopy =
|
|
752
|
+
nextProp = this._previousStyleCopy = _assign({}, nextProp);
|
|
750
753
|
} else {
|
|
751
754
|
this._previousStyleCopy = null;
|
|
752
755
|
}
|
|
@@ -779,10 +782,6 @@ ReactDOMComponent.Mixin = {
|
|
|
779
782
|
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
|
780
783
|
DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
|
|
781
784
|
}
|
|
782
|
-
} else if (this._namespaceURI === DOMNamespaces.svg) {
|
|
783
|
-
if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
|
784
|
-
DOMPropertyOperations.setValueForSVGAttribute(getNode(this), propKey, nextProp);
|
|
785
|
-
}
|
|
786
785
|
} else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
|
|
787
786
|
var node = getNode(this);
|
|
788
787
|
// If we're updating to null or undefined, we should remove the property
|
|
@@ -901,6 +900,6 @@ ReactPerf.measureMethods(ReactDOMComponent.Mixin, 'ReactDOMComponent', {
|
|
|
901
900
|
receiveComponent: 'receiveComponent'
|
|
902
901
|
});
|
|
903
902
|
|
|
904
|
-
|
|
903
|
+
_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
|
|
905
904
|
|
|
906
905
|
module.exports = ReactDOMComponent;
|
package/lib/ReactDOMDebugTool.js
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
var ReactDOMUnknownPropertyDevtool = require('./ReactDOMUnknownPropertyDevtool');
|
|
15
|
-
var ReactDOMSVGDeprecatedAttributeDevtool = require('./ReactDOMSVGDeprecatedAttributeDevtool');
|
|
16
15
|
|
|
17
16
|
var warning = require('fbjs/lib/warning');
|
|
18
17
|
|
|
@@ -49,21 +48,14 @@ var ReactDOMDebugTool = {
|
|
|
49
48
|
onCreateMarkupForProperty: function (name, value) {
|
|
50
49
|
emitEvent('onCreateMarkupForProperty', name, value);
|
|
51
50
|
},
|
|
52
|
-
onCreateMarkupForSVGAttribute: function (name, value) {
|
|
53
|
-
emitEvent('onCreateMarkupForSVGAttribute', name, value);
|
|
54
|
-
},
|
|
55
51
|
onSetValueForProperty: function (node, name, value) {
|
|
56
52
|
emitEvent('onSetValueForProperty', node, name, value);
|
|
57
53
|
},
|
|
58
|
-
onSetValueForSVGAttribute: function (node, name, value) {
|
|
59
|
-
emitEvent('onSetValueForSVGAttribute', node, name, value);
|
|
60
|
-
},
|
|
61
54
|
onDeleteValueForProperty: function (node, name) {
|
|
62
55
|
emitEvent('onDeleteValueForProperty', node, name);
|
|
63
56
|
}
|
|
64
57
|
};
|
|
65
58
|
|
|
66
59
|
ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);
|
|
67
|
-
ReactDOMDebugTool.addDevtool(ReactDOMSVGDeprecatedAttributeDevtool);
|
|
68
60
|
|
|
69
61
|
module.exports = ReactDOMDebugTool;
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var DOMLazyTree = require('./DOMLazyTree');
|
|
15
17
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
16
18
|
|
|
17
|
-
var assign = require('./Object.assign');
|
|
18
|
-
|
|
19
19
|
var ReactDOMEmptyComponent = function (instantiate) {
|
|
20
20
|
// ReactCompositeComponent uses this:
|
|
21
21
|
this._currentElement = null;
|
|
@@ -25,7 +25,7 @@ var ReactDOMEmptyComponent = function (instantiate) {
|
|
|
25
25
|
this._nativeContainerInfo = null;
|
|
26
26
|
this._domID = null;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
_assign(ReactDOMEmptyComponent.prototype, {
|
|
29
29
|
mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
|
|
30
30
|
var domID = nativeContainerInfo._idCounter++;
|
|
31
31
|
this._domID = domID;
|
package/lib/ReactDOMInput.js
CHANGED
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var DOMPropertyOperations = require('./DOMPropertyOperations');
|
|
15
17
|
var LinkedValueUtils = require('./LinkedValueUtils');
|
|
16
18
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
17
19
|
var ReactUpdates = require('./ReactUpdates');
|
|
18
20
|
|
|
19
|
-
var assign = require('./Object.assign');
|
|
20
21
|
var invariant = require('fbjs/lib/invariant');
|
|
21
22
|
var warning = require('fbjs/lib/warning');
|
|
22
23
|
|
|
@@ -64,7 +65,7 @@ var ReactDOMInput = {
|
|
|
64
65
|
var value = LinkedValueUtils.getValue(props);
|
|
65
66
|
var checked = LinkedValueUtils.getChecked(props);
|
|
66
67
|
|
|
67
|
-
var nativeProps =
|
|
68
|
+
var nativeProps = _assign({
|
|
68
69
|
// Make sure we set .type before any other properties (setting .value
|
|
69
70
|
// before .type means .value is lost in IE11 and below)
|
|
70
71
|
type: undefined
|
|
@@ -127,11 +128,11 @@ var ReactDOMInput = {
|
|
|
127
128
|
var owner = inst._currentElement._owner;
|
|
128
129
|
|
|
129
130
|
if ((initialValue || !inst._wrapperState.controlled) && controlled && !didWarnUncontrolledToControlled) {
|
|
130
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or
|
|
131
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
|
131
132
|
didWarnUncontrolledToControlled = true;
|
|
132
133
|
}
|
|
133
134
|
if (inst._wrapperState.controlled && (defaultValue || !controlled) && !didWarnControlledToUncontrolled) {
|
|
134
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or
|
|
135
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
|
135
136
|
didWarnControlledToUncontrolled = true;
|
|
136
137
|
}
|
|
137
138
|
}
|
package/lib/ReactDOMOption.js
CHANGED
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var ReactChildren = require('./ReactChildren');
|
|
17
|
+
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
15
18
|
var ReactDOMSelect = require('./ReactDOMSelect');
|
|
16
19
|
|
|
17
|
-
var assign = require('./Object.assign');
|
|
18
20
|
var warning = require('fbjs/lib/warning');
|
|
19
21
|
|
|
20
22
|
/**
|
|
@@ -54,8 +56,17 @@ var ReactDOMOption = {
|
|
|
54
56
|
inst._wrapperState = { selected: selected };
|
|
55
57
|
},
|
|
56
58
|
|
|
59
|
+
postMountWrapper: function (inst) {
|
|
60
|
+
// value="" should make a value attribute (#6219)
|
|
61
|
+
var props = inst._currentElement.props;
|
|
62
|
+
if (props.value != null) {
|
|
63
|
+
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
|
64
|
+
node.setAttribute('value', props.value);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
57
68
|
getNativeProps: function (inst, props) {
|
|
58
|
-
var nativeProps =
|
|
69
|
+
var nativeProps = _assign({ selected: undefined, children: undefined }, props);
|
|
59
70
|
|
|
60
71
|
// Read state only from initial mount because <select> updates value
|
|
61
72
|
// manually; we need the initial state only for server rendering
|