react 15.3.1-rc.1 → 15.3.1-rc.2

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.
@@ -69,7 +69,11 @@ var ReactDOMInput = {
69
69
  type: undefined,
70
70
  // Make sure we set .step before .value (setting .value before .step
71
71
  // means .value is rounded on mount, based upon step precision)
72
- step: undefined
72
+ step: undefined,
73
+ // Make sure we set .min & .max before .value (to ensure proper order
74
+ // in corner cases such as min or max deriving from value, e.g. Issue #7170)
75
+ min: undefined,
76
+ max: undefined
73
77
  }, DisabledInputUtils.getHostProps(inst, props), {
74
78
  defaultChecked: undefined,
75
79
  defaultValue: undefined,
@@ -56,6 +56,34 @@ function hasValidKey(config) {
56
56
  return config.key !== undefined;
57
57
  }
58
58
 
59
+ function defineKeyPropWarningGetter(props, displayName) {
60
+ var warnAboutAccessingKey = function () {
61
+ if (!specialPropKeyWarningShown) {
62
+ specialPropKeyWarningShown = true;
63
+ process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
64
+ }
65
+ };
66
+ warnAboutAccessingKey.isReactWarning = true;
67
+ Object.defineProperty(props, 'key', {
68
+ get: warnAboutAccessingKey,
69
+ configurable: true
70
+ });
71
+ }
72
+
73
+ function defineRefPropWarningGetter(props, displayName) {
74
+ var warnAboutAccessingRef = function () {
75
+ if (!specialPropRefWarningShown) {
76
+ specialPropRefWarningShown = true;
77
+ process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
78
+ }
79
+ };
80
+ warnAboutAccessingRef.isReactWarning = true;
81
+ Object.defineProperty(props, 'ref', {
82
+ get: warnAboutAccessingRef,
83
+ configurable: true
84
+ });
85
+ }
86
+
59
87
  /**
60
88
  * Factory method to create a new React element. This no longer adheres to
61
89
  * the class pattern, so do not use new to call it. Also, no instanceof check
@@ -210,39 +238,15 @@ ReactElement.createElement = function (type, config, children) {
210
238
  }
211
239
  }
212
240
  if (process.env.NODE_ENV !== 'production') {
213
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
214
-
215
- // Create dummy `key` and `ref` property to `props` to warn users against its use
216
- var warnAboutAccessingKey = function () {
217
- if (!specialPropKeyWarningShown) {
218
- specialPropKeyWarningShown = true;
219
- process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
220
- }
221
- return undefined;
222
- };
223
- warnAboutAccessingKey.isReactWarning = true;
224
-
225
- var warnAboutAccessingRef = function () {
226
- if (!specialPropRefWarningShown) {
227
- specialPropRefWarningShown = true;
228
- process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0;
229
- }
230
- return undefined;
231
- };
232
- warnAboutAccessingRef.isReactWarning = true;
233
-
234
- if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
235
- if (!props.hasOwnProperty('key')) {
236
- Object.defineProperty(props, 'key', {
237
- get: warnAboutAccessingKey,
238
- configurable: true
239
- });
240
- }
241
- if (!props.hasOwnProperty('ref')) {
242
- Object.defineProperty(props, 'ref', {
243
- get: warnAboutAccessingRef,
244
- configurable: true
245
- });
241
+ if (key || ref) {
242
+ if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
243
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
244
+ if (key) {
245
+ defineKeyPropWarningGetter(props, displayName);
246
+ }
247
+ if (ref) {
248
+ defineRefPropWarningGetter(props, displayName);
249
+ }
246
250
  }
247
251
  }
248
252
  }
@@ -11,4 +11,4 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- module.exports = '15.3.1-rc.1';
14
+ module.exports = '15.3.1-rc.2';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react",
3
3
  "description": "React is a JavaScript library for building user interfaces.",
4
- "version": "15.3.1-rc.1",
4
+ "version": "15.3.1-rc.2",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],