aboutsummaryrefslogtreecommitdiff
path: root/node_modules/react/dist/react.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/react/dist/react.js
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/react/dist/react.js')
-rw-r--r--node_modules/react/dist/react.js2339
1 files changed, 1336 insertions, 1003 deletions
diff --git a/node_modules/react/dist/react.js b/node_modules/react/dist/react.js
index 9f8f480fc..e0ef89948 100644
--- a/node_modules/react/dist/react.js
+++ b/node_modules/react/dist/react.js
@@ -1,5 +1,5 @@
/**
- * React v15.5.4
+ * React v15.6.1
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
/**
@@ -76,7 +76,7 @@ module.exports = KeyEscapeUtils;
var _prodInvariant = _dereq_(25);
-var invariant = _dereq_(29);
+var invariant = _dereq_(30);
/**
* Static poolers. Several custom versions for each potential number of
@@ -172,7 +172,7 @@ var PooledClass = {
};
module.exports = PooledClass;
-},{"25":25,"29":29}],3:[function(_dereq_,module,exports){
+},{"25":25,"30":30}],3:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -185,27 +185,26 @@ module.exports = PooledClass;
'use strict';
-var _assign = _dereq_(31);
+var _assign = _dereq_(32);
-var ReactChildren = _dereq_(4);
-var ReactComponent = _dereq_(6);
-var ReactPureComponent = _dereq_(17);
-var ReactClass = _dereq_(5);
-var ReactDOMFactories = _dereq_(9);
-var ReactElement = _dereq_(10);
-var ReactPropTypes = _dereq_(15);
-var ReactVersion = _dereq_(19);
+var ReactBaseClasses = _dereq_(4);
+var ReactChildren = _dereq_(5);
+var ReactDOMFactories = _dereq_(8);
+var ReactElement = _dereq_(9);
+var ReactPropTypes = _dereq_(14);
+var ReactVersion = _dereq_(17);
+var createReactClass = _dereq_(20);
var onlyChild = _dereq_(24);
-var warning = _dereq_(30);
var createElement = ReactElement.createElement;
var createFactory = ReactElement.createFactory;
var cloneElement = ReactElement.cloneElement;
if ("development" !== 'production') {
- var canDefineProperty = _dereq_(20);
- var ReactElementValidator = _dereq_(12);
+ var lowPriorityWarning = _dereq_(23);
+ var canDefineProperty = _dereq_(18);
+ var ReactElementValidator = _dereq_(11);
var didWarnPropTypesDeprecated = false;
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
@@ -213,18 +212,27 @@ if ("development" !== 'production') {
}
var __spread = _assign;
+var createMixin = function (mixin) {
+ return mixin;
+};
if ("development" !== 'production') {
- var warned = false;
+ var warnedForSpread = false;
+ var warnedForCreateMixin = false;
__spread = function () {
- "development" !== '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;
- warned = true;
+ lowPriorityWarning(warnedForSpread, '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.');
+ warnedForSpread = true;
return _assign.apply(null, arguments);
};
+
+ createMixin = function (mixin) {
+ lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.');
+ warnedForCreateMixin = true;
+ return mixin;
+ };
}
var React = {
-
// Modern
Children: {
@@ -235,8 +243,8 @@ var React = {
only: onlyChild
},
- Component: ReactComponent,
- PureComponent: ReactPureComponent,
+ Component: ReactBaseClasses.Component,
+ PureComponent: ReactBaseClasses.PureComponent,
createElement: createElement,
cloneElement: cloneElement,
@@ -245,12 +253,9 @@ var React = {
// Classic
PropTypes: ReactPropTypes,
- createClass: ReactClass.createClass,
+ createClass: createReactClass,
createFactory: createFactory,
- createMixin: function (mixin) {
- // Currently a noop. Will be used to validate and trace mixins.
- return mixin;
- },
+ createMixin: createMixin,
// This looks DOM specific but these are actually isomorphic helpers
// since they are just generating DOM strings.
@@ -262,21 +267,187 @@ var React = {
__spread: __spread
};
-// TODO: Fix tests so that this deprecation warning doesn't cause failures.
if ("development" !== 'production') {
+ var warnedForCreateClass = false;
if (canDefineProperty) {
Object.defineProperty(React, 'PropTypes', {
get: function () {
- "development" !== 'production' ? warning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated. Use ' + 'the prop-types package from npm instead.') : void 0;
+ lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs');
didWarnPropTypesDeprecated = true;
return ReactPropTypes;
}
});
+
+ Object.defineProperty(React, 'createClass', {
+ get: function () {
+ lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class');
+ warnedForCreateClass = true;
+ return createReactClass;
+ }
+ });
}
+
+ // React.DOM factories are deprecated. Wrap these methods so that
+ // invocations of the React.DOM namespace and alert users to switch
+ // to the `react-dom-factories` package.
+ React.DOM = {};
+ var warnedForFactories = false;
+ Object.keys(ReactDOMFactories).forEach(function (factory) {
+ React.DOM[factory] = function () {
+ if (!warnedForFactories) {
+ lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory);
+ warnedForFactories = true;
+ }
+ return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments);
+ };
+ });
}
module.exports = React;
-},{"10":10,"12":12,"15":15,"17":17,"19":19,"20":20,"24":24,"30":30,"31":31,"4":4,"5":5,"6":6,"9":9}],4:[function(_dereq_,module,exports){
+},{"11":11,"14":14,"17":17,"18":18,"20":20,"23":23,"24":24,"32":32,"4":4,"5":5,"8":8,"9":9}],4:[function(_dereq_,module,exports){
+/**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+'use strict';
+
+var _prodInvariant = _dereq_(25),
+ _assign = _dereq_(32);
+
+var ReactNoopUpdateQueue = _dereq_(12);
+
+var canDefineProperty = _dereq_(18);
+var emptyObject = _dereq_(29);
+var invariant = _dereq_(30);
+var lowPriorityWarning = _dereq_(23);
+
+/**
+ * Base class helpers for the updating state of a component.
+ */
+function ReactComponent(props, context, updater) {
+ this.props = props;
+ this.context = context;
+ this.refs = emptyObject;
+ // We initialize the default updater but the real one gets injected by the
+ // renderer.
+ this.updater = updater || ReactNoopUpdateQueue;
+}
+
+ReactComponent.prototype.isReactComponent = {};
+
+/**
+ * Sets a subset of the state. Always use this to mutate
+ * state. You should treat `this.state` as immutable.
+ *
+ * There is no guarantee that `this.state` will be immediately updated, so
+ * accessing `this.state` after calling this method may return the old value.
+ *
+ * There is no guarantee that calls to `setState` will run synchronously,
+ * as they may eventually be batched together. You can provide an optional
+ * callback that will be executed when the call to setState is actually
+ * completed.
+ *
+ * When a function is provided to setState, it will be called at some point in
+ * the future (not synchronously). It will be called with the up to date
+ * component arguments (state, props, context). These values can be different
+ * from this.* because your function may be called after receiveProps but before
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
+ * assigned to this.
+ *
+ * @param {object|function} partialState Next partial state or function to
+ * produce next partial state to be merged with current state.
+ * @param {?function} callback Called after state is updated.
+ * @final
+ * @protected
+ */
+ReactComponent.prototype.setState = function (partialState, callback) {
+ !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
+ this.updater.enqueueSetState(this, partialState);
+ if (callback) {
+ this.updater.enqueueCallback(this, callback, 'setState');
+ }
+};
+
+/**
+ * Forces an update. This should only be invoked when it is known with
+ * certainty that we are **not** in a DOM transaction.
+ *
+ * You may want to call this when you know that some deeper aspect of the
+ * component's state has changed but `setState` was not called.
+ *
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
+ * `componentWillUpdate` and `componentDidUpdate`.
+ *
+ * @param {?function} callback Called after update is complete.
+ * @final
+ * @protected
+ */
+ReactComponent.prototype.forceUpdate = function (callback) {
+ this.updater.enqueueForceUpdate(this);
+ if (callback) {
+ this.updater.enqueueCallback(this, callback, 'forceUpdate');
+ }
+};
+
+/**
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
+ * we would like to deprecate them, we're not going to move them over to this
+ * modern base class. Instead, we define a getter that warns if it's accessed.
+ */
+if ("development" !== 'production') {
+ var deprecatedAPIs = {
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
+ };
+ var defineDeprecationWarning = function (methodName, info) {
+ if (canDefineProperty) {
+ Object.defineProperty(ReactComponent.prototype, methodName, {
+ get: function () {
+ lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
+ return undefined;
+ }
+ });
+ }
+ };
+ for (var fnName in deprecatedAPIs) {
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
+ }
+ }
+}
+
+/**
+ * Base class helpers for the updating state of a component.
+ */
+function ReactPureComponent(props, context, updater) {
+ // Duplicated from ReactComponent.
+ this.props = props;
+ this.context = context;
+ this.refs = emptyObject;
+ // We initialize the default updater but the real one gets injected by the
+ // renderer.
+ this.updater = updater || ReactNoopUpdateQueue;
+}
+
+function ComponentDummy() {}
+ComponentDummy.prototype = ReactComponent.prototype;
+ReactPureComponent.prototype = new ComponentDummy();
+ReactPureComponent.prototype.constructor = ReactPureComponent;
+// Avoid an extra prototype jump for these methods.
+_assign(ReactPureComponent.prototype, ReactComponent.prototype);
+ReactPureComponent.prototype.isPureReactComponent = true;
+
+module.exports = {
+ Component: ReactComponent,
+ PureComponent: ReactPureComponent
+};
+},{"12":12,"18":18,"23":23,"25":25,"29":29,"30":30,"32":32}],5:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -290,9 +461,9 @@ module.exports = React;
'use strict';
var PooledClass = _dereq_(2);
-var ReactElement = _dereq_(10);
+var ReactElement = _dereq_(9);
-var emptyFunction = _dereq_(27);
+var emptyFunction = _dereq_(28);
var traverseAllChildren = _dereq_(26);
var twoArgumentPooler = PooledClass.twoArgumentPooler;
@@ -467,848 +638,7 @@ var ReactChildren = {
};
module.exports = ReactChildren;
-},{"10":10,"2":2,"26":26,"27":27}],5:[function(_dereq_,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = _dereq_(25),
- _assign = _dereq_(31);
-
-var ReactComponent = _dereq_(6);
-var ReactElement = _dereq_(10);
-var ReactPropTypeLocationNames = _dereq_(14);
-var ReactNoopUpdateQueue = _dereq_(13);
-
-var emptyObject = _dereq_(28);
-var invariant = _dereq_(29);
-var warning = _dereq_(30);
-
-var MIXINS_KEY = 'mixins';
-
-// Helper function to allow the creation of anonymous functions which do not
-// have .name set to the name of the variable being assigned to.
-function identity(fn) {
- return fn;
-}
-
-/**
- * Policies that describe methods in `ReactClassInterface`.
- */
-
-
-var injectedMixins = [];
-
-/**
- * Composite components are higher-level components that compose other composite
- * or host components.
- *
- * To create a new type of `ReactClass`, pass a specification of
- * your new class to `React.createClass`. The only requirement of your class
- * specification is that you implement a `render` method.
- *
- * var MyComponent = React.createClass({
- * render: function() {
- * return <div>Hello World</div>;
- * }
- * });
- *
- * The class specification supports a specific protocol of methods that have
- * special meaning (e.g. `render`). See `ReactClassInterface` for
- * more the comprehensive protocol. Any other properties and methods in the
- * class specification will be available on the prototype.
- *
- * @interface ReactClassInterface
- * @internal
- */
-var ReactClassInterface = {
-
- /**
- * An array of Mixin objects to include when defining your component.
- *
- * @type {array}
- * @optional
- */
- mixins: 'DEFINE_MANY',
-
- /**
- * An object containing properties and methods that should be defined on
- * the component's constructor instead of its prototype (static methods).
- *
- * @type {object}
- * @optional
- */
- statics: 'DEFINE_MANY',
-
- /**
- * Definition of prop types for this component.
- *
- * @type {object}
- * @optional
- */
- propTypes: 'DEFINE_MANY',
-
- /**
- * Definition of context types for this component.
- *
- * @type {object}
- * @optional
- */
- contextTypes: 'DEFINE_MANY',
-
- /**
- * Definition of context types this component sets for its children.
- *
- * @type {object}
- * @optional
- */
- childContextTypes: 'DEFINE_MANY',
-
- // ==== Definition methods ====
-
- /**
- * Invoked when the component is mounted. Values in the mapping will be set on
- * `this.props` if that prop is not specified (i.e. using an `in` check).
- *
- * This method is invoked before `getInitialState` and therefore cannot rely
- * on `this.state` or use `this.setState`.
- *
- * @return {object}
- * @optional
- */
- getDefaultProps: 'DEFINE_MANY_MERGED',
-
- /**
- * Invoked once before the component is mounted. The return value will be used
- * as the initial value of `this.state`.
- *
- * getInitialState: function() {
- * return {
- * isOn: false,
- * fooBaz: new BazFoo()
- * }
- * }
- *
- * @return {object}
- * @optional
- */
- getInitialState: 'DEFINE_MANY_MERGED',
-
- /**
- * @return {object}
- * @optional
- */
- getChildContext: 'DEFINE_MANY_MERGED',
-
- /**
- * Uses props from `this.props` and state from `this.state` to render the
- * structure of the component.
- *
- * No guarantees are made about when or how often this method is invoked, so
- * it must not have side effects.
- *
- * render: function() {
- * var name = this.props.name;
- * return <div>Hello, {name}!</div>;
- * }
- *
- * @return {ReactComponent}
- * @required
- */
- render: 'DEFINE_ONCE',
-
- // ==== Delegate methods ====
-
- /**
- * Invoked when the component is initially created and about to be mounted.
- * This may have side effects, but any external subscriptions or data created
- * by this method must be cleaned up in `componentWillUnmount`.
- *
- * @optional
- */
- componentWillMount: 'DEFINE_MANY',
-
- /**
- * Invoked when the component has been mounted and has a DOM representation.
- * However, there is no guarantee that the DOM node is in the document.
- *
- * Use this as an opportunity to operate on the DOM when the component has
- * been mounted (initialized and rendered) for the first time.
- *
- * @param {DOMElement} rootNode DOM element representing the component.
- * @optional
- */
- componentDidMount: 'DEFINE_MANY',
-
- /**
- * Invoked before the component receives new props.
- *
- * Use this as an opportunity to react to a prop transition by updating the
- * state using `this.setState`. Current props are accessed via `this.props`.
- *
- * componentWillReceiveProps: function(nextProps, nextContext) {
- * this.setState({
- * likesIncreasing: nextProps.likeCount > this.props.likeCount
- * });
- * }
- *
- * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
- * transition may cause a state change, but the opposite is not true. If you
- * need it, you are probably looking for `componentWillUpdate`.
- *
- * @param {object} nextProps
- * @optional
- */
- componentWillReceiveProps: 'DEFINE_MANY',
-
- /**
- * Invoked while deciding if the component should be updated as a result of
- * receiving new props, state and/or context.
- *
- * Use this as an opportunity to `return false` when you're certain that the
- * transition to the new props/state/context will not require a component
- * update.
- *
- * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
- * return !equal(nextProps, this.props) ||
- * !equal(nextState, this.state) ||
- * !equal(nextContext, this.context);
- * }
- *
- * @param {object} nextProps
- * @param {?object} nextState
- * @param {?object} nextContext
- * @return {boolean} True if the component should update.
- * @optional
- */
- shouldComponentUpdate: 'DEFINE_ONCE',
-
- /**
- * Invoked when the component is about to update due to a transition from
- * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
- * and `nextContext`.
- *
- * Use this as an opportunity to perform preparation before an update occurs.
- *
- * NOTE: You **cannot** use `this.setState()` in this method.
- *
- * @param {object} nextProps
- * @param {?object} nextState
- * @param {?object} nextContext
- * @param {ReactReconcileTransaction} transaction
- * @optional
- */
- componentWillUpdate: 'DEFINE_MANY',
-
- /**
- * Invoked when the component's DOM representation has been updated.
- *
- * Use this as an opportunity to operate on the DOM when the component has
- * been updated.
- *
- * @param {object} prevProps
- * @param {?object} prevState
- * @param {?object} prevContext
- * @param {DOMElement} rootNode DOM element representing the component.
- * @optional
- */
- componentDidUpdate: 'DEFINE_MANY',
-
- /**
- * Invoked when the component is about to be removed from its parent and have
- * its DOM representation destroyed.
- *
- * Use this as an opportunity to deallocate any external resources.
- *
- * NOTE: There is no `componentDidUnmount` since your component will have been
- * destroyed by that point.
- *
- * @optional
- */
- componentWillUnmount: 'DEFINE_MANY',
-
- // ==== Advanced methods ====
-
- /**
- * Updates the component's currently mounted DOM representation.
- *
- * By default, this implements React's rendering and reconciliation algorithm.
- * Sophisticated clients may wish to override this.
- *
- * @param {ReactReconcileTransaction} transaction
- * @internal
- * @overridable
- */
- updateComponent: 'OVERRIDE_BASE'
-
-};
-
-/**
- * Mapping from class specification keys to special processing functions.
- *
- * Although these are declared like instance properties in the specification
- * when defining classes using `React.createClass`, they are actually static
- * and are accessible on the constructor instead of the prototype. Despite
- * being static, they must be defined outside of the "statics" key under
- * which all other static methods are defined.
- */
-var RESERVED_SPEC_KEYS = {
- displayName: function (Constructor, displayName) {
- Constructor.displayName = displayName;
- },
- mixins: function (Constructor, mixins) {
- if (mixins) {
- for (var i = 0; i < mixins.length; i++) {
- mixSpecIntoComponent(Constructor, mixins[i]);
- }
- }
- },
- childContextTypes: function (Constructor, childContextTypes) {
- if ("development" !== 'production') {
- validateTypeDef(Constructor, childContextTypes, 'childContext');
- }
- Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
- },
- contextTypes: function (Constructor, contextTypes) {
- if ("development" !== 'production') {
- validateTypeDef(Constructor, contextTypes, 'context');
- }
- Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
- },
- /**
- * Special case getDefaultProps which should move into statics but requires
- * automatic merging.
- */
- getDefaultProps: function (Constructor, getDefaultProps) {
- if (Constructor.getDefaultProps) {
- Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
- } else {
- Constructor.getDefaultProps = getDefaultProps;
- }
- },
- propTypes: function (Constructor, propTypes) {
- if ("development" !== 'production') {
- validateTypeDef(Constructor, propTypes, 'prop');
- }
- Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
- },
- statics: function (Constructor, statics) {
- mixStaticSpecIntoComponent(Constructor, statics);
- },
- autobind: function () {} };
-
-function validateTypeDef(Constructor, typeDef, location) {
- for (var propName in typeDef) {
- if (typeDef.hasOwnProperty(propName)) {
- // use a warning instead of an invariant so components
- // don't show up in prod but only in __DEV__
- "development" !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
- }
- }
-}
-
-function validateMethodOverride(isAlreadyDefined, name) {
- var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
-
- // Disallow overriding of base class methods unless explicitly allowed.
- if (ReactClassMixin.hasOwnProperty(name)) {
- !(specPolicy === 'OVERRIDE_BASE') ? "development" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0;
- }
-
- // Disallow defining methods more than once unless explicitly allowed.
- if (isAlreadyDefined) {
- !(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? "development" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0;
- }
-}
-
-/**
- * Mixin helper which handles policy validation and reserved
- * specification keys when building React classes.
- */
-function mixSpecIntoComponent(Constructor, spec) {
- if (!spec) {
- if ("development" !== 'production') {
- var typeofSpec = typeof spec;
- var isMixinValid = typeofSpec === 'object' && spec !== null;
-
- "development" !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
- }
-
- return;
- }
-
- !(typeof spec !== 'function') ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;
- !!ReactElement.isValidElement(spec) ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;
-
- var proto = Constructor.prototype;
- var autoBindPairs = proto.__reactAutoBindPairs;
-
- // By handling mixins before any other properties, we ensure the same
- // chaining order is applied to methods with DEFINE_MANY policy, whether
- // mixins are listed before or after these methods in the spec.
- if (spec.hasOwnProperty(MIXINS_KEY)) {
- RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
- }
-
- for (var name in spec) {
- if (!spec.hasOwnProperty(name)) {
- continue;
- }
-
- if (name === MIXINS_KEY) {
- // We have already handled mixins in a special case above.
- continue;
- }
-
- var property = spec[name];
- var isAlreadyDefined = proto.hasOwnProperty(name);
- validateMethodOverride(isAlreadyDefined, name);
-
- if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
- RESERVED_SPEC_KEYS[name](Constructor, property);
- } else {
- // Setup methods on prototype:
- // The following member methods should not be automatically bound:
- // 1. Expected ReactClass methods (in the "interface").
- // 2. Overridden methods (that were mixed in).
- var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
- var isFunction = typeof property === 'function';
- var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
-
- if (shouldAutoBind) {
- autoBindPairs.push(name, property);
- proto[name] = property;
- } else {
- if (isAlreadyDefined) {
- var specPolicy = ReactClassInterface[name];
-
- // These cases should already be caught by validateMethodOverride.
- !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? "development" !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
-
- // For methods which are defined more than once, call the existing
- // methods before calling the new property, merging if appropriate.
- if (specPolicy === 'DEFINE_MANY_MERGED') {
- proto[name] = createMergedResultFunction(proto[name], property);
- } else if (specPolicy === 'DEFINE_MANY') {
- proto[name] = createChainedFunction(proto[name], property);
- }
- } else {
- proto[name] = property;
- if ("development" !== 'production') {
- // Add verbose displayName to the function, which helps when looking
- // at profiling tools.
- if (typeof property === 'function' && spec.displayName) {
- proto[name].displayName = spec.displayName + '_' + name;
- }
- }
- }
- }
- }
- }
-}
-
-function mixStaticSpecIntoComponent(Constructor, statics) {
- if (!statics) {
- return;
- }
- for (var name in statics) {
- var property = statics[name];
- if (!statics.hasOwnProperty(name)) {
- continue;
- }
-
- var isReserved = name in RESERVED_SPEC_KEYS;
- !!isReserved ? "development" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : _prodInvariant('78', name) : void 0;
-
- var isInherited = name in Constructor;
- !!isInherited ? "development" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : void 0;
- Constructor[name] = property;
- }
-}
-
-/**
- * Merge two objects, but throw if both contain the same key.
- *
- * @param {object} one The first object, which is mutated.
- * @param {object} two The second object
- * @return {object} one after it has been mutated to contain everything in two.
- */
-function mergeIntoWithNoDuplicateKeys(one, two) {
- !(one && two && typeof one === 'object' && typeof two === 'object') ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
-
- for (var key in two) {
- if (two.hasOwnProperty(key)) {
- !(one[key] === undefined) ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : _prodInvariant('81', key) : void 0;
- one[key] = two[key];
- }
- }
- return one;
-}
-
-/**
- * Creates a function that invokes two functions and merges their return values.
- *
- * @param {function} one Function to invoke first.
- * @param {function} two Function to invoke second.
- * @return {function} Function that invokes the two argument functions.
- * @private
- */
-function createMergedResultFunction(one, two) {
- return function mergedResult() {
- var a = one.apply(this, arguments);
- var b = two.apply(this, arguments);
- if (a == null) {
- return b;
- } else if (b == null) {
- return a;
- }
- var c = {};
- mergeIntoWithNoDuplicateKeys(c, a);
- mergeIntoWithNoDuplicateKeys(c, b);
- return c;
- };
-}
-
-/**
- * Creates a function that invokes two functions and ignores their return vales.
- *
- * @param {function} one Function to invoke first.
- * @param {function} two Function to invoke second.
- * @return {function} Function that invokes the two argument functions.
- * @private
- */
-function createChainedFunction(one, two) {
- return function chainedFunction() {
- one.apply(this, arguments);
- two.apply(this, arguments);
- };
-}
-
-/**
- * Binds a method to the component.
- *
- * @param {object} component Component whose method is going to be bound.
- * @param {function} method Method to be bound.
- * @return {function} The bound method.
- */
-function bindAutoBindMethod(component, method) {
- var boundMethod = method.bind(component);
- if ("development" !== 'production') {
- boundMethod.__reactBoundContext = component;
- boundMethod.__reactBoundMethod = method;
- boundMethod.__reactBoundArguments = null;
- var componentName = component.constructor.displayName;
- var _bind = boundMethod.bind;
- boundMethod.bind = function (newThis) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- // User is trying to bind() an autobound method; we effectively will
- // ignore the value of "this" that the user is trying to use, so
- // let's warn.
- if (newThis !== component && newThis !== null) {
- "development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
- } else if (!args.length) {
- "development" !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : void 0;
- return boundMethod;
- }
- var reboundMethod = _bind.apply(boundMethod, arguments);
- reboundMethod.__reactBoundContext = component;
- reboundMethod.__reactBoundMethod = method;
- reboundMethod.__reactBoundArguments = args;
- return reboundMethod;
- };
- }
- return boundMethod;
-}
-
-/**
- * Binds all auto-bound methods in a component.
- *
- * @param {object} component Component whose method is going to be bound.
- */
-function bindAutoBindMethods(component) {
- var pairs = component.__reactAutoBindPairs;
- for (var i = 0; i < pairs.length; i += 2) {
- var autoBindKey = pairs[i];
- var method = pairs[i + 1];
- component[autoBindKey] = bindAutoBindMethod(component, method);
- }
-}
-
-/**
- * Add more to the ReactClass base class. These are all legacy features and
- * therefore not already part of the modern ReactComponent.
- */
-var ReactClassMixin = {
-
- /**
- * TODO: This will be deprecated because state should always keep a consistent
- * type signature and the only use case for this, is to avoid that.
- */
- replaceState: function (newState, callback) {
- this.updater.enqueueReplaceState(this, newState);
- if (callback) {
- this.updater.enqueueCallback(this, callback, 'replaceState');
- }
- },
-
- /**
- * Checks whether or not this composite component is mounted.
- * @return {boolean} True if mounted, false otherwise.
- * @protected
- * @final
- */
- isMounted: function () {
- return this.updater.isMounted(this);
- }
-};
-
-var ReactClassComponent = function () {};
-_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
-
-var didWarnDeprecated = false;
-
-/**
- * Module for creating composite components.
- *
- * @class ReactClass
- */
-var ReactClass = {
-
- /**
- * Creates a composite component class given a class specification.
- * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
- *
- * @param {object} spec Class specification (which must define `render`).
- * @return {function} Component constructor function.
- * @public
- */
- createClass: function (spec) {
- if ("development" !== 'production') {
- "development" !== 'production' ? warning(didWarnDeprecated, '%s: React.createClass is deprecated and will be removed in version 16. ' + 'Use plain JavaScript classes instead. If you\'re not yet ready to ' + 'migrate, create-react-class is available on npm as a ' + 'drop-in replacement.', spec && spec.displayName || 'A Component') : void 0;
- didWarnDeprecated = true;
- }
-
- // To keep our warnings more understandable, we'll use a little hack here to
- // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
- // unnecessarily identify a class without displayName as 'Constructor'.
- var Constructor = identity(function (props, context, updater) {
- // This constructor gets overridden by mocks. The argument is used
- // by mocks to assert on what gets mounted.
-
- if ("development" !== 'production') {
- "development" !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
- }
-
- // Wire up auto-binding
- if (this.__reactAutoBindPairs.length) {
- bindAutoBindMethods(this);
- }
-
- this.props = props;
- this.context = context;
- this.refs = emptyObject;
- this.updater = updater || ReactNoopUpdateQueue;
-
- this.state = null;
-
- // ReactClasses doesn't have constructors. Instead, they use the
- // getInitialState and componentWillMount methods for initialization.
-
- var initialState = this.getInitialState ? this.getInitialState() : null;
- if ("development" !== 'production') {
- // We allow auto-mocks to proceed as if they're returning null.
- if (initialState === undefined && this.getInitialState._isMockFunction) {
- // This is probably bad practice. Consider warning here and
- // deprecating this convenience.
- initialState = null;
- }
- }
- !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0;
-
- this.state = initialState;
- });
- Constructor.prototype = new ReactClassComponent();
- Constructor.prototype.constructor = Constructor;
- Constructor.prototype.__reactAutoBindPairs = [];
-
- injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
-
- mixSpecIntoComponent(Constructor, spec);
-
- // Initialize the defaultProps property after all mixins have been merged.
- if (Constructor.getDefaultProps) {
- Constructor.defaultProps = Constructor.getDefaultProps();
- }
-
- if ("development" !== 'production') {
- // This is a tag to indicate that the use of these method names is ok,
- // since it's used with createClass. If it's not, then it's likely a
- // mistake so we'll warn you to use the static property, property
- // initializer or constructor respectively.
- if (Constructor.getDefaultProps) {
- Constructor.getDefaultProps.isReactClassApproved = {};
- }
- if (Constructor.prototype.getInitialState) {
- Constructor.prototype.getInitialState.isReactClassApproved = {};
- }
- }
-
- !Constructor.prototype.render ? "development" !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
-
- if ("development" !== 'production') {
- "development" !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : void 0;
- "development" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
- }
-
- // Reduce time spent doing lookups by setting these on the prototype.
- for (var methodName in ReactClassInterface) {
- if (!Constructor.prototype[methodName]) {
- Constructor.prototype[methodName] = null;
- }
- }
-
- return Constructor;
- },
-
- injection: {
- injectMixin: function (mixin) {
- injectedMixins.push(mixin);
- }
- }
-
-};
-
-module.exports = ReactClass;
-},{"10":10,"13":13,"14":14,"25":25,"28":28,"29":29,"30":30,"31":31,"6":6}],6:[function(_dereq_,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _prodInvariant = _dereq_(25);
-
-var ReactNoopUpdateQueue = _dereq_(13);
-
-var canDefineProperty = _dereq_(20);
-var emptyObject = _dereq_(28);
-var invariant = _dereq_(29);
-var warning = _dereq_(30);
-
-/**
- * Base class helpers for the updating state of a component.
- */
-function ReactComponent(props, context, updater) {
- this.props = props;
- this.context = context;
- this.refs = emptyObject;
- // We initialize the default updater but the real one gets injected by the
- // renderer.
- this.updater = updater || ReactNoopUpdateQueue;
-}
-
-ReactComponent.prototype.isReactComponent = {};
-
-/**
- * Sets a subset of the state. Always use this to mutate
- * state. You should treat `this.state` as immutable.
- *
- * There is no guarantee that `this.state` will be immediately updated, so
- * accessing `this.state` after calling this method may return the old value.
- *
- * There is no guarantee that calls to `setState` will run synchronously,
- * as they may eventually be batched together. You can provide an optional
- * callback that will be executed when the call to setState is actually
- * completed.
- *
- * When a function is provided to setState, it will be called at some point in
- * the future (not synchronously). It will be called with the up to date
- * component arguments (state, props, context). These values can be different
- * from this.* because your function may be called after receiveProps but before
- * shouldComponentUpdate, and this new state, props, and context will not yet be
- * assigned to this.
- *
- * @param {object|function} partialState Next partial state or function to
- * produce next partial state to be merged with current state.
- * @param {?function} callback Called after state is updated.
- * @final
- * @protected
- */
-ReactComponent.prototype.setState = function (partialState, callback) {
- !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
- this.updater.enqueueSetState(this, partialState);
- if (callback) {
- this.updater.enqueueCallback(this, callback, 'setState');
- }
-};
-
-/**
- * Forces an update. This should only be invoked when it is known with
- * certainty that we are **not** in a DOM transaction.
- *
- * You may want to call this when you know that some deeper aspect of the
- * component's state has changed but `setState` was not called.
- *
- * This will not invoke `shouldComponentUpdate`, but it will invoke
- * `componentWillUpdate` and `componentDidUpdate`.
- *
- * @param {?function} callback Called after update is complete.
- * @final
- * @protected
- */
-ReactComponent.prototype.forceUpdate = function (callback) {
- this.updater.enqueueForceUpdate(this);
- if (callback) {
- this.updater.enqueueCallback(this, callback, 'forceUpdate');
- }
-};
-
-/**
- * Deprecated APIs. These APIs used to exist on classic React classes but since
- * we would like to deprecate them, we're not going to move them over to this
- * modern base class. Instead, we define a getter that warns if it's accessed.
- */
-if ("development" !== 'production') {
- var deprecatedAPIs = {
- isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
- replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
- };
- var defineDeprecationWarning = function (methodName, info) {
- if (canDefineProperty) {
- Object.defineProperty(ReactComponent.prototype, methodName, {
- get: function () {
- "development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
- return undefined;
- }
- });
- }
- };
- for (var fnName in deprecatedAPIs) {
- if (deprecatedAPIs.hasOwnProperty(fnName)) {
- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
- }
- }
-}
-
-module.exports = ReactComponent;
-},{"13":13,"20":20,"25":25,"28":28,"29":29,"30":30}],7:[function(_dereq_,module,exports){
+},{"2":2,"26":26,"28":28,"9":9}],6:[function(_dereq_,module,exports){
/**
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.
@@ -1324,10 +654,10 @@ module.exports = ReactComponent;
var _prodInvariant = _dereq_(25);
-var ReactCurrentOwner = _dereq_(8);
+var ReactCurrentOwner = _dereq_(7);
-var invariant = _dereq_(29);
-var warning = _dereq_(30);
+var invariant = _dereq_(30);
+var warning = _dereq_(31);
function isNative(fn) {
// Based on isNative() from Lodash
@@ -1335,11 +665,11 @@ function isNative(fn) {
var hasOwnProperty = Object.prototype.hasOwnProperty;
var reIsNative = RegExp('^' + funcToString
// Take an example native function source for comparison
- .call(hasOwnProperty)
+ .call(hasOwnProperty
// Strip regex characters so we can use it for regex
- .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
+ ).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&'
// Remove hasOwnProperty from the template to make it generic
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
+ ).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
try {
var source = funcToString.call(fn);
return reIsNative.test(source);
@@ -1638,11 +968,56 @@ var ReactComponentTreeHook = {
getRootIDs: getRootIDs,
- getRegisteredIDs: getItemIDs
+ getRegisteredIDs: getItemIDs,
+
+ pushNonStandardWarningStack: function (isCreatingElement, currentSource) {
+ if (typeof console.reactStack !== 'function') {
+ return;
+ }
+
+ var stack = [];
+ var currentOwner = ReactCurrentOwner.current;
+ var id = currentOwner && currentOwner._debugID;
+
+ try {
+ if (isCreatingElement) {
+ stack.push({
+ name: id ? ReactComponentTreeHook.getDisplayName(id) : null,
+ fileName: currentSource ? currentSource.fileName : null,
+ lineNumber: currentSource ? currentSource.lineNumber : null
+ });
+ }
+
+ while (id) {
+ var element = ReactComponentTreeHook.getElement(id);
+ var parentID = ReactComponentTreeHook.getParentID(id);
+ var ownerID = ReactComponentTreeHook.getOwnerID(id);
+ var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null;
+ var source = element && element._source;
+ stack.push({
+ name: ownerName,
+ fileName: source ? source.fileName : null,
+ lineNumber: source ? source.lineNumber : null
+ });
+ id = parentID;
+ }
+ } catch (err) {
+ // Internal state is messed up.
+ // Stop building the stack (it's just a nice to have).
+ }
+
+ console.reactStack(stack);
+ },
+ popNonStandardWarningStack: function () {
+ if (typeof console.reactStackEnd !== 'function') {
+ return;
+ }
+ console.reactStackEnd();
+ }
};
module.exports = ReactComponentTreeHook;
-},{"25":25,"29":29,"30":30,"8":8}],8:[function(_dereq_,module,exports){
+},{"25":25,"30":30,"31":31,"7":7}],7:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -1663,17 +1038,15 @@ module.exports = ReactComponentTreeHook;
* currently being constructed.
*/
var ReactCurrentOwner = {
-
/**
* @internal
* @type {ReactComponent}
*/
current: null
-
};
module.exports = ReactCurrentOwner;
-},{}],9:[function(_dereq_,module,exports){
+},{}],8:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -1686,7 +1059,7 @@ module.exports = ReactCurrentOwner;
'use strict';
-var ReactElement = _dereq_(10);
+var ReactElement = _dereq_(9);
/**
* Create a factory that creates HTML tag elements.
@@ -1695,13 +1068,12 @@ var ReactElement = _dereq_(10);
*/
var createDOMFactory = ReactElement.createFactory;
if ("development" !== 'production') {
- var ReactElementValidator = _dereq_(12);
+ var ReactElementValidator = _dereq_(11);
createDOMFactory = ReactElementValidator.createFactory;
}
/**
* Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
- * This is also accessible via `React.DOM`.
*
* @public
*/
@@ -1843,7 +1215,7 @@ var ReactDOMFactories = {
};
module.exports = ReactDOMFactories;
-},{"10":10,"12":12}],10:[function(_dereq_,module,exports){
+},{"11":11,"9":9}],9:[function(_dereq_,module,exports){
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
@@ -1856,15 +1228,15 @@ module.exports = ReactDOMFactories;
'use strict';
-var _assign = _dereq_(31);
+var _assign = _dereq_(32);
-var ReactCurrentOwner = _dereq_(8);
+var ReactCurrentOwner = _dereq_(7);
-var warning = _dereq_(30);
-var canDefineProperty = _dereq_(20);
+var warning = _dereq_(31);
+var canDefineProperty = _dereq_(18);
var hasOwnProperty = Object.prototype.hasOwnProperty;
-var REACT_ELEMENT_TYPE = _dereq_(11);
+var REACT_ELEMENT_TYPE = _dereq_(10);
var RESERVED_PROPS = {
key: true,
@@ -2184,7 +1556,7 @@ ReactElement.isValidElement = function (object) {
};
module.exports = ReactElement;
-},{"11":11,"20":20,"30":30,"31":31,"8":8}],11:[function(_dereq_,module,exports){
+},{"10":10,"18":18,"31":31,"32":32,"7":7}],10:[function(_dereq_,module,exports){
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
@@ -2204,7 +1576,7 @@ module.exports = ReactElement;
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
module.exports = REACT_ELEMENT_TYPE;
-},{}],12:[function(_dereq_,module,exports){
+},{}],11:[function(_dereq_,module,exports){
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
@@ -2224,15 +1596,16 @@ module.exports = REACT_ELEMENT_TYPE;
'use strict';
-var ReactCurrentOwner = _dereq_(8);
-var ReactComponentTreeHook = _dereq_(7);
-var ReactElement = _dereq_(10);
+var ReactCurrentOwner = _dereq_(7);
+var ReactComponentTreeHook = _dereq_(6);
+var ReactElement = _dereq_(9);
-var checkReactTypeSpec = _dereq_(21);
+var checkReactTypeSpec = _dereq_(19);
-var canDefineProperty = _dereq_(20);
-var getIteratorFn = _dereq_(22);
-var warning = _dereq_(30);
+var canDefineProperty = _dereq_(18);
+var getIteratorFn = _dereq_(21);
+var warning = _dereq_(31);
+var lowPriorityWarning = _dereq_(23);
function getDeclarationErrorAddendum() {
if (ReactCurrentOwner.current) {
@@ -2373,7 +1746,6 @@ function validatePropTypes(element) {
}
var ReactElementValidator = {
-
createElement: function (type, props, children) {
var validType = typeof type === 'string' || typeof type === 'function';
// We warn in this case but don't throw. We expect the element creation to
@@ -2382,7 +1754,7 @@ var ReactElementValidator = {
if (typeof type !== 'function' && typeof type !== 'string') {
var info = '';
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
- info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
+ info += ' You likely forgot to export your component from the file ' + "it's defined in.";
}
var sourceInfo = getSourceInfoErrorAddendum(props);
@@ -2394,7 +1766,10 @@ var ReactElementValidator = {
info += ReactComponentTreeHook.getCurrentStackAddendum();
+ var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null;
+ ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource);
"development" !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
+ ReactComponentTreeHook.popNonStandardWarningStack();
}
}
@@ -2432,7 +1807,7 @@ var ReactElementValidator = {
Object.defineProperty(validatedFactory, 'type', {
enumerable: false,
get: function () {
- "development" !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
+ lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
Object.defineProperty(this, 'type', {
value: type
});
@@ -2453,11 +1828,10 @@ var ReactElementValidator = {
validatePropTypes(newElement);
return newElement;
}
-
};
module.exports = ReactElementValidator;
-},{"10":10,"20":20,"21":21,"22":22,"30":30,"7":7,"8":8}],13:[function(_dereq_,module,exports){
+},{"18":18,"19":19,"21":21,"23":23,"31":31,"6":6,"7":7,"9":9}],12:[function(_dereq_,module,exports){
/**
* Copyright 2015-present, Facebook, Inc.
* All rights reserved.
@@ -2470,7 +1844,7 @@ module.exports = ReactElementValidator;
'use strict';
-var warning = _dereq_(30);
+var warning = _dereq_(31);
function warnNoop(publicInstance, callerName) {
if ("development" !== 'production') {
@@ -2483,7 +1857,6 @@ function warnNoop(publicInstance, callerName) {
* This is the abstract API for an update queue.
*/
var ReactNoopUpdateQueue = {
-
/**
* Checks whether or not this composite component is mounted.
* @param {ReactClass} publicInstance The instance we want to test.
@@ -2553,7 +1926,7 @@ var ReactNoopUpdateQueue = {
};
module.exports = ReactNoopUpdateQueue;
-},{"30":30}],14:[function(_dereq_,module,exports){
+},{"31":31}],13:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -2578,7 +1951,7 @@ if ("development" !== 'production') {
}
module.exports = ReactPropTypeLocationNames;
-},{}],15:[function(_dereq_,module,exports){
+},{}],14:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -2591,13 +1964,13 @@ module.exports = ReactPropTypeLocationNames;
'use strict';
-var _require = _dereq_(10),
+var _require = _dereq_(9),
isValidElement = _require.isValidElement;
-var factory = _dereq_(33);
+var factory = _dereq_(34);
module.exports = factory(isValidElement);
-},{"10":10,"33":33}],16:[function(_dereq_,module,exports){
+},{"34":34,"9":9}],15:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -2614,7 +1987,7 @@ module.exports = factory(isValidElement);
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
-},{}],17:[function(_dereq_,module,exports){
+},{}],16:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -2627,69 +2000,27 @@ module.exports = ReactPropTypesSecret;
'use strict';
-var _assign = _dereq_(31);
-
-var ReactComponent = _dereq_(6);
-var ReactNoopUpdateQueue = _dereq_(13);
-
-var emptyObject = _dereq_(28);
-
-/**
- * Base class helpers for the updating state of a component.
- */
-function ReactPureComponent(props, context, updater) {
- // Duplicated from ReactComponent.
- this.props = props;
- this.context = context;
- this.refs = emptyObject;
- // We initialize the default updater but the real one gets injected by the
- // renderer.
- this.updater = updater || ReactNoopUpdateQueue;
-}
-
-function ComponentDummy() {}
-ComponentDummy.prototype = ReactComponent.prototype;
-ReactPureComponent.prototype = new ComponentDummy();
-ReactPureComponent.prototype.constructor = ReactPureComponent;
-// Avoid an extra prototype jump for these methods.
-_assign(ReactPureComponent.prototype, ReactComponent.prototype);
-ReactPureComponent.prototype.isPureReactComponent = true;
-
-module.exports = ReactPureComponent;
-},{"13":13,"28":28,"31":31,"6":6}],18:[function(_dereq_,module,exports){
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-'use strict';
-
-var _assign = _dereq_(31);
+var _assign = _dereq_(32);
var React = _dereq_(3);
// `version` will be added here by the React module.
var ReactUMDEntry = _assign(React, {
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
- ReactCurrentOwner: _dereq_(8)
+ ReactCurrentOwner: _dereq_(7)
}
});
if ("development" !== 'production') {
_assign(ReactUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
// ReactComponentTreeHook should not be included in production.
- ReactComponentTreeHook: _dereq_(7),
- getNextDebugID: _dereq_(23)
+ ReactComponentTreeHook: _dereq_(6),
+ getNextDebugID: _dereq_(22)
});
}
module.exports = ReactUMDEntry;
-},{"23":23,"3":3,"31":31,"7":7,"8":8}],19:[function(_dereq_,module,exports){
+},{"22":22,"3":3,"32":32,"6":6,"7":7}],17:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -2702,8 +2033,8 @@ module.exports = ReactUMDEntry;
'use strict';
-module.exports = '15.5.4';
-},{}],20:[function(_dereq_,module,exports){
+module.exports = '15.6.1';
+},{}],18:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -2729,7 +2060,7 @@ if ("development" !== 'production') {
}
module.exports = canDefineProperty;
-},{}],21:[function(_dereq_,module,exports){
+},{}],19:[function(_dereq_,module,exports){
(function (process){
/**
* Copyright 2013-present, Facebook, Inc.
@@ -2745,11 +2076,11 @@ module.exports = canDefineProperty;
var _prodInvariant = _dereq_(25);
-var ReactPropTypeLocationNames = _dereq_(14);
-var ReactPropTypesSecret = _dereq_(16);
+var ReactPropTypeLocationNames = _dereq_(13);
+var ReactPropTypesSecret = _dereq_(15);
-var invariant = _dereq_(29);
-var warning = _dereq_(30);
+var invariant = _dereq_(30);
+var warning = _dereq_(31);
var ReactComponentTreeHook;
@@ -2759,7 +2090,7 @@ if (typeof process !== 'undefined' && process.env && "development" === 'test') {
// https://github.com/facebook/react/issues/7240
// Remove the inline requires when we don't need them anymore:
// https://github.com/facebook/react/pull/7178
- ReactComponentTreeHook = _dereq_(7);
+ ReactComponentTreeHook = _dereq_(6);
}
var loggedTypeFailures = {};
@@ -2801,7 +2132,7 @@ function checkReactTypeSpec(typeSpecs, values, location, componentName, element,
if ("development" !== 'production') {
if (!ReactComponentTreeHook) {
- ReactComponentTreeHook = _dereq_(7);
+ ReactComponentTreeHook = _dereq_(6);
}
if (debugID !== null) {
componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
@@ -2818,7 +2149,30 @@ function checkReactTypeSpec(typeSpecs, values, location, componentName, element,
module.exports = checkReactTypeSpec;
}).call(this,undefined)
-},{"14":14,"16":16,"25":25,"29":29,"30":30,"7":7}],22:[function(_dereq_,module,exports){
+},{"13":13,"15":15,"25":25,"30":30,"31":31,"6":6}],20:[function(_dereq_,module,exports){
+/**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+'use strict';
+
+var _require = _dereq_(4),
+ Component = _require.Component;
+
+var _require2 = _dereq_(9),
+ isValidElement = _require2.isValidElement;
+
+var ReactNoopUpdateQueue = _dereq_(12);
+var factory = _dereq_(27);
+
+module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue);
+},{"12":12,"27":27,"4":4,"9":9}],21:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -2859,7 +2213,7 @@ function getIteratorFn(maybeIterable) {
}
module.exports = getIteratorFn;
-},{}],23:[function(_dereq_,module,exports){
+},{}],22:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -2880,6 +2234,71 @@ function getNextDebugID() {
}
module.exports = getNextDebugID;
+},{}],23:[function(_dereq_,module,exports){
+/**
+ * Copyright 2014-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+'use strict';
+
+/**
+ * Forked from fbjs/warning:
+ * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
+ *
+ * Only change is we use console.warn instead of console.error,
+ * and do nothing when 'console' is not supported.
+ * This really simplifies the code.
+ * ---
+ * Similar to invariant but only logs a warning if the condition is not met.
+ * This can be used to log issues in development environments in critical
+ * paths. Removing the logging code for production environments will keep the
+ * same logic and follow the same code paths.
+ */
+
+var lowPriorityWarning = function () {};
+
+if ("development" !== 'production') {
+ var printWarning = function (format) {
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ var argIndex = 0;
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
+ return args[argIndex++];
+ });
+ if (typeof console !== 'undefined') {
+ console.warn(message);
+ }
+ try {
+ // --- Welcome to debugging React ---
+ // This error was thrown as a convenience so that you can use this stack
+ // to find the callsite that caused this warning to fire.
+ throw new Error(message);
+ } catch (x) {}
+ };
+
+ lowPriorityWarning = function (condition, format) {
+ if (format === undefined) {
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
+ }
+ if (!condition) {
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
+ args[_key2 - 2] = arguments[_key2];
+ }
+
+ printWarning.apply(undefined, [format].concat(args));
+ }
+ };
+}
+
+module.exports = lowPriorityWarning;
},{}],24:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
@@ -2894,9 +2313,9 @@ module.exports = getNextDebugID;
var _prodInvariant = _dereq_(25);
-var ReactElement = _dereq_(10);
+var ReactElement = _dereq_(9);
-var invariant = _dereq_(29);
+var invariant = _dereq_(30);
/**
* Returns the first child in a collection of children and verifies that there
@@ -2918,7 +2337,7 @@ function onlyChild(children) {
}
module.exports = onlyChild;
-},{"10":10,"25":25,"29":29}],25:[function(_dereq_,module,exports){
+},{"25":25,"30":30,"9":9}],25:[function(_dereq_,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
@@ -2972,13 +2391,13 @@ module.exports = reactProdInvariant;
var _prodInvariant = _dereq_(25);
-var ReactCurrentOwner = _dereq_(8);
-var REACT_ELEMENT_TYPE = _dereq_(11);
+var ReactCurrentOwner = _dereq_(7);
+var REACT_ELEMENT_TYPE = _dereq_(10);
-var getIteratorFn = _dereq_(22);
-var invariant = _dereq_(29);
+var getIteratorFn = _dereq_(21);
+var invariant = _dereq_(30);
var KeyEscapeUtils = _dereq_(1);
-var warning = _dereq_(30);
+var warning = _dereq_(31);
var SEPARATOR = '.';
var SUBSEPARATOR = ':';
@@ -3091,7 +2510,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
if ("development" !== 'production') {
addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
if (children._isReactElement) {
- addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
+ addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.';
}
if (ReactCurrentOwner.current) {
var name = ReactCurrentOwner.current.getName();
@@ -3133,7 +2552,881 @@ function traverseAllChildren(children, callback, traverseContext) {
}
module.exports = traverseAllChildren;
-},{"1":1,"11":11,"22":22,"25":25,"29":29,"30":30,"8":8}],27:[function(_dereq_,module,exports){
+},{"1":1,"10":10,"21":21,"25":25,"30":30,"31":31,"7":7}],27:[function(_dereq_,module,exports){
+/**
+ * Copyright 2013-present, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ */
+
+'use strict';
+
+var _assign = _dereq_(32);
+
+var emptyObject = _dereq_(29);
+var _invariant = _dereq_(30);
+
+if ("development" !== 'production') {
+ var warning = _dereq_(31);
+}
+
+var MIXINS_KEY = 'mixins';
+
+// Helper function to allow the creation of anonymous functions which do not
+// have .name set to the name of the variable being assigned to.
+function identity(fn) {
+ return fn;
+}
+
+var ReactPropTypeLocationNames;
+if ("development" !== 'production') {
+ ReactPropTypeLocationNames = {
+ prop: 'prop',
+ context: 'context',
+ childContext: 'child context'
+ };
+} else {
+ ReactPropTypeLocationNames = {};
+}
+
+function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
+ /**
+ * Policies that describe methods in `ReactClassInterface`.
+ */
+
+ var injectedMixins = [];
+
+ /**
+ * Composite components are higher-level components that compose other composite
+ * or host components.
+ *
+ * To create a new type of `ReactClass`, pass a specification of
+ * your new class to `React.createClass`. The only requirement of your class
+ * specification is that you implement a `render` method.
+ *
+ * var MyComponent = React.createClass({
+ * render: function() {
+ * return <div>Hello World</div>;
+ * }
+ * });
+ *
+ * The class specification supports a specific protocol of methods that have
+ * special meaning (e.g. `render`). See `ReactClassInterface` for
+ * more the comprehensive protocol. Any other properties and methods in the
+ * class specification will be available on the prototype.
+ *
+ * @interface ReactClassInterface
+ * @internal
+ */
+ var ReactClassInterface = {
+ /**
+ * An array of Mixin objects to include when defining your component.
+ *
+ * @type {array}
+ * @optional
+ */
+ mixins: 'DEFINE_MANY',
+
+ /**
+ * An object containing properties and methods that should be defined on
+ * the component's constructor instead of its prototype (static methods).
+ *
+ * @type {object}
+ * @optional
+ */
+ statics: 'DEFINE_MANY',
+
+ /**
+ * Definition of prop types for this component.
+ *
+ * @type {object}
+ * @optional
+ */
+ propTypes: 'DEFINE_MANY',
+
+ /**
+ * Definition of context types for this component.
+ *
+ * @type {object}
+ * @optional
+ */
+ contextTypes: 'DEFINE_MANY',
+
+ /**
+ * Definition of context types this component sets for its children.
+ *
+ * @type {object}
+ * @optional
+ */
+ childContextTypes: 'DEFINE_MANY',
+
+ // ==== Definition methods ====
+
+ /**
+ * Invoked when the component is mounted. Values in the mapping will be set on
+ * `this.props` if that prop is not specified (i.e. using an `in` check).
+ *
+ * This method is invoked before `getInitialState` and therefore cannot rely
+ * on `this.state` or use `this.setState`.
+ *
+ * @return {object}
+ * @optional
+ */
+ getDefaultProps: 'DEFINE_MANY_MERGED',
+
+ /**
+ * Invoked once before the component is mounted. The return value will be used
+ * as the initial value of `this.state`.
+ *
+ * getInitialState: function() {
+ * return {
+ * isOn: false,
+ * fooBaz: new BazFoo()
+ * }
+ * }
+ *
+ * @return {object}
+ * @optional
+ */
+ getInitialState: 'DEFINE_MANY_MERGED',
+
+ /**
+ * @return {object}
+ * @optional
+ */
+ getChildContext: 'DEFINE_MANY_MERGED',
+
+ /**
+ * Uses props from `this.props` and state from `this.state` to render the
+ * structure of the component.
+ *
+ * No guarantees are made about when or how often this method is invoked, so
+ * it must not have side effects.
+ *
+ * render: function() {
+ * var name = this.props.name;
+ * return <div>Hello, {name}!</div>;
+ * }
+ *
+ * @return {ReactComponent}
+ * @required
+ */
+ render: 'DEFINE_ONCE',
+
+ // ==== Delegate methods ====
+
+ /**
+ * Invoked when the component is initially created and about to be mounted.
+ * This may have side effects, but any external subscriptions or data created
+ * by this method must be cleaned up in `componentWillUnmount`.
+ *
+ * @optional
+ */
+ componentWillMount: 'DEFINE_MANY',
+
+ /**
+ * Invoked when the component has been mounted and has a DOM representation.
+ * However, there is no guarantee that the DOM node is in the document.
+ *
+ * Use this as an opportunity to operate on the DOM when the component has
+ * been mounted (initialized and rendered) for the first time.
+ *
+ * @param {DOMElement} rootNode DOM element representing the component.
+ * @optional
+ */
+ componentDidMount: 'DEFINE_MANY',
+
+ /**
+ * Invoked before the component receives new props.
+ *
+ * Use this as an opportunity to react to a prop transition by updating the
+ * state using `this.setState`. Current props are accessed via `this.props`.
+ *
+ * componentWillReceiveProps: function(nextProps, nextContext) {
+ * this.setState({
+ * likesIncreasing: nextProps.likeCount > this.props.likeCount
+ * });
+ * }
+ *
+ * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
+ * transition may cause a state change, but the opposite is not true. If you
+ * need it, you are probably looking for `componentWillUpdate`.
+ *
+ * @param {object} nextProps
+ * @optional
+ */
+ componentWillReceiveProps: 'DEFINE_MANY',
+
+ /**
+ * Invoked while deciding if the component should be updated as a result of
+ * receiving new props, state and/or context.
+ *
+ * Use this as an opportunity to `return false` when you're certain that the
+ * transition to the new props/state/context will not require a component
+ * update.
+ *
+ * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
+ * return !equal(nextProps, this.props) ||
+ * !equal(nextState, this.state) ||
+ * !equal(nextContext, this.context);
+ * }
+ *
+ * @param {object} nextProps
+ * @param {?object} nextState
+ * @param {?object} nextContext
+ * @return {boolean} True if the component should update.
+ * @optional
+ */
+ shouldComponentUpdate: 'DEFINE_ONCE',
+
+ /**
+ * Invoked when the component is about to update due to a transition from
+ * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
+ * and `nextContext`.
+ *
+ * Use this as an opportunity to perform preparation before an update occurs.
+ *
+ * NOTE: You **cannot** use `this.setState()` in this method.
+ *
+ * @param {object} nextProps
+ * @param {?object} nextState
+ * @param {?object} nextContext
+ * @param {ReactReconcileTransaction} transaction
+ * @optional
+ */
+ componentWillUpdate: 'DEFINE_MANY',
+
+ /**
+ * Invoked when the component's DOM representation has been updated.
+ *
+ * Use this as an opportunity to operate on the DOM when the component has
+ * been updated.
+ *
+ * @param {object} prevProps
+ * @param {?object} prevState
+ * @param {?object} prevContext
+ * @param {DOMElement} rootNode DOM element representing the component.
+ * @optional
+ */
+ componentDidUpdate: 'DEFINE_MANY',
+
+ /**
+ * Invoked when the component is about to be removed from its parent and have
+ * its DOM representation destroyed.
+ *
+ * Use this as an opportunity to deallocate any external resources.
+ *
+ * NOTE: There is no `componentDidUnmount` since your component will have been
+ * destroyed by that point.
+ *
+ * @optional
+ */
+ componentWillUnmount: 'DEFINE_MANY',
+
+ // ==== Advanced methods ====
+
+ /**
+ * Updates the component's currently mounted DOM representation.
+ *
+ * By default, this implements React's rendering and reconciliation algorithm.
+ * Sophisticated clients may wish to override this.
+ *
+ * @param {ReactReconcileTransaction} transaction
+ * @internal
+ * @overridable
+ */
+ updateComponent: 'OVERRIDE_BASE'
+ };
+
+ /**
+ * Mapping from class specification keys to special processing functions.
+ *
+ * Although these are declared like instance properties in the specification
+ * when defining classes using `React.createClass`, they are actually static
+ * and are accessible on the constructor instead of the prototype. Despite
+ * being static, they must be defined outside of the "statics" key under
+ * which all other static methods are defined.
+ */
+ var RESERVED_SPEC_KEYS = {
+ displayName: function(Constructor, displayName) {
+ Constructor.displayName = displayName;
+ },
+ mixins: function(Constructor, mixins) {
+ if (mixins) {
+ for (var i = 0; i < mixins.length; i++) {
+ mixSpecIntoComponent(Constructor, mixins[i]);
+ }
+ }
+ },
+ childContextTypes: function(Constructor, childContextTypes) {
+ if ("development" !== 'production') {
+ validateTypeDef(Constructor, childContextTypes, 'childContext');
+ }
+ Constructor.childContextTypes = _assign(
+ {},
+ Constructor.childContextTypes,
+ childContextTypes
+ );
+ },
+ contextTypes: function(Constructor, contextTypes) {
+ if ("development" !== 'production') {
+ validateTypeDef(Constructor, contextTypes, 'context');
+ }
+ Constructor.contextTypes = _assign(
+ {},
+ Constructor.contextTypes,
+ contextTypes
+ );
+ },
+ /**
+ * Special case getDefaultProps which should move into statics but requires
+ * automatic merging.
+ */
+ getDefaultProps: function(Constructor, getDefaultProps) {
+ if (Constructor.getDefaultProps) {
+ Constructor.getDefaultProps = createMergedResultFunction(
+ Constructor.getDefaultProps,
+ getDefaultProps
+ );
+ } else {
+ Constructor.getDefaultProps = getDefaultProps;
+ }
+ },
+ propTypes: function(Constructor, propTypes) {
+ if ("development" !== 'production') {
+ validateTypeDef(Constructor, propTypes, 'prop');
+ }
+ Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
+ },
+ statics: function(Constructor, statics) {
+ mixStaticSpecIntoComponent(Constructor, statics);
+ },
+ autobind: function() {}
+ };
+
+ function validateTypeDef(Constructor, typeDef, location) {
+ for (var propName in typeDef) {
+ if (typeDef.hasOwnProperty(propName)) {
+ // use a warning instead of an _invariant so components
+ // don't show up in prod but only in __DEV__
+ if ("development" !== 'production') {
+ warning(
+ typeof typeDef[propName] === 'function',
+ '%s: %s type `%s` is invalid; it must be a function, usually from ' +
+ 'React.PropTypes.',
+ Constructor.displayName || 'ReactClass',
+ ReactPropTypeLocationNames[location],
+ propName
+ );
+ }
+ }
+ }
+ }
+
+ function validateMethodOverride(isAlreadyDefined, name) {
+ var specPolicy = ReactClassInterface.hasOwnProperty(name)
+ ? ReactClassInterface[name]
+ : null;
+
+ // Disallow overriding of base class methods unless explicitly allowed.
+ if (ReactClassMixin.hasOwnProperty(name)) {
+ _invariant(
+ specPolicy === 'OVERRIDE_BASE',
+ 'ReactClassInterface: You are attempting to override ' +
+ '`%s` from your class specification. Ensure that your method names ' +
+ 'do not overlap with React methods.',
+ name
+ );
+ }
+
+ // Disallow defining methods more than once unless explicitly allowed.
+ if (isAlreadyDefined) {
+ _invariant(
+ specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
+ 'ReactClassInterface: You are attempting to define ' +
+ '`%s` on your component more than once. This conflict may be due ' +
+ 'to a mixin.',
+ name
+ );
+ }
+ }
+
+ /**
+ * Mixin helper which handles policy validation and reserved
+ * specification keys when building React classes.
+ */
+ function mixSpecIntoComponent(Constructor, spec) {
+ if (!spec) {
+ if ("development" !== 'production') {
+ var typeofSpec = typeof spec;
+ var isMixinValid = typeofSpec === 'object' && spec !== null;
+
+ if ("development" !== 'production') {
+ warning(
+ isMixinValid,
+ "%s: You're attempting to include a mixin that is either null " +
+ 'or not an object. Check the mixins included by the component, ' +
+ 'as well as any mixins they include themselves. ' +
+ 'Expected object but got %s.',
+ Constructor.displayName || 'ReactClass',
+ spec === null ? null : typeofSpec
+ );
+ }
+ }
+
+ return;
+ }
+
+ _invariant(
+ typeof spec !== 'function',
+ "ReactClass: You're attempting to " +
+ 'use a component class or function as a mixin. Instead, just use a ' +
+ 'regular object.'
+ );
+ _invariant(
+ !isValidElement(spec),
+ "ReactClass: You're attempting to " +
+ 'use a component as a mixin. Instead, just use a regular object.'
+ );
+
+ var proto = Constructor.prototype;
+ var autoBindPairs = proto.__reactAutoBindPairs;
+
+ // By handling mixins before any other properties, we ensure the same
+ // chaining order is applied to methods with DEFINE_MANY policy, whether
+ // mixins are listed before or after these methods in the spec.
+ if (spec.hasOwnProperty(MIXINS_KEY)) {
+ RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
+ }
+
+ for (var name in spec) {
+ if (!spec.hasOwnProperty(name)) {
+ continue;
+ }
+
+ if (name === MIXINS_KEY) {
+ // We have already handled mixins in a special case above.
+ continue;
+ }
+
+ var property = spec[name];
+ var isAlreadyDefined = proto.hasOwnProperty(name);
+ validateMethodOverride(isAlreadyDefined, name);
+
+ if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
+ RESERVED_SPEC_KEYS[name](Constructor, property);
+ } else {
+ // Setup methods on prototype:
+ // The following member methods should not be automatically bound:
+ // 1. Expected ReactClass methods (in the "interface").
+ // 2. Overridden methods (that were mixed in).
+ var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
+ var isFunction = typeof property === 'function';
+ var shouldAutoBind =
+ isFunction &&
+ !isReactClassMethod &&
+ !isAlreadyDefined &&
+ spec.autobind !== false;
+
+ if (shouldAutoBind) {
+ autoBindPairs.push(name, property);
+ proto[name] = property;
+ } else {
+ if (isAlreadyDefined) {
+ var specPolicy = ReactClassInterface[name];
+
+ // These cases should already be caught by validateMethodOverride.
+ _invariant(
+ isReactClassMethod &&
+ (specPolicy === 'DEFINE_MANY_MERGED' ||
+ specPolicy === 'DEFINE_MANY'),
+ 'ReactClass: Unexpected spec policy %s for key %s ' +
+ 'when mixing in component specs.',
+ specPolicy,
+ name
+ );
+
+ // For methods which are defined more than once, call the existing
+ // methods before calling the new property, merging if appropriate.
+ if (specPolicy === 'DEFINE_MANY_MERGED') {
+ proto[name] = createMergedResultFunction(proto[name], property);
+ } else if (specPolicy === 'DEFINE_MANY') {
+ proto[name] = createChainedFunction(proto[name], property);
+ }
+ } else {
+ proto[name] = property;
+ if ("development" !== 'production') {
+ // Add verbose displayName to the function, which helps when looking
+ // at profiling tools.
+ if (typeof property === 'function' && spec.displayName) {
+ proto[name].displayName = spec.displayName + '_' + name;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ function mixStaticSpecIntoComponent(Constructor, statics) {
+ if (!statics) {
+ return;
+ }
+ for (var name in statics) {
+ var property = statics[name];
+ if (!statics.hasOwnProperty(name)) {
+ continue;
+ }
+
+ var isReserved = name in RESERVED_SPEC_KEYS;
+ _invariant(
+ !isReserved,
+ 'ReactClass: You are attempting to define a reserved ' +
+ 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
+ 'as an instance property instead; it will still be accessible on the ' +
+ 'constructor.',
+ name
+ );
+
+ var isInherited = name in Constructor;
+ _invariant(
+ !isInherited,
+ 'ReactClass: You are attempting to define ' +
+ '`%s` on your component more than once. This conflict may be ' +
+ 'due to a mixin.',
+ name
+ );
+ Constructor[name] = property;
+ }
+ }
+
+ /**
+ * Merge two objects, but throw if both contain the same key.
+ *
+ * @param {object} one The first object, which is mutated.
+ * @param {object} two The second object
+ * @return {object} one after it has been mutated to contain everything in two.
+ */
+ function mergeIntoWithNoDuplicateKeys(one, two) {
+ _invariant(
+ one && two && typeof one === 'object' && typeof two === 'object',
+ 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
+ );
+
+ for (var key in two) {
+ if (two.hasOwnProperty(key)) {
+ _invariant(
+ one[key] === undefined,
+ 'mergeIntoWithNoDuplicateKeys(): ' +
+ 'Tried to merge two objects with the same key: `%s`. This conflict ' +
+ 'may be due to a mixin; in particular, this may be caused by two ' +
+ 'getInitialState() or getDefaultProps() methods returning objects ' +
+ 'with clashing keys.',
+ key
+ );
+ one[key] = two[key];
+ }
+ }
+ return one;
+ }
+
+ /**
+ * Creates a function that invokes two functions and merges their return values.
+ *
+ * @param {function} one Function to invoke first.
+ * @param {function} two Function to invoke second.
+ * @return {function} Function that invokes the two argument functions.
+ * @private
+ */
+ function createMergedResultFunction(one, two) {
+ return function mergedResult() {
+ var a = one.apply(this, arguments);
+ var b = two.apply(this, arguments);
+ if (a == null) {
+ return b;
+ } else if (b == null) {
+ return a;
+ }
+ var c = {};
+ mergeIntoWithNoDuplicateKeys(c, a);
+ mergeIntoWithNoDuplicateKeys(c, b);
+ return c;
+ };
+ }
+
+ /**
+ * Creates a function that invokes two functions and ignores their return vales.
+ *
+ * @param {function} one Function to invoke first.
+ * @param {function} two Function to invoke second.
+ * @return {function} Function that invokes the two argument functions.
+ * @private
+ */
+ function createChainedFunction(one, two) {
+ return function chainedFunction() {
+ one.apply(this, arguments);
+ two.apply(this, arguments);
+ };
+ }
+
+ /**
+ * Binds a method to the component.
+ *
+ * @param {object} component Component whose method is going to be bound.
+ * @param {function} method Method to be bound.
+ * @return {function} The bound method.
+ */
+ function bindAutoBindMethod(component, method) {
+ var boundMethod = method.bind(component);
+ if ("development" !== 'production') {
+ boundMethod.__reactBoundContext = component;
+ boundMethod.__reactBoundMethod = method;
+ boundMethod.__reactBoundArguments = null;
+ var componentName = component.constructor.displayName;
+ var _bind = boundMethod.bind;
+ boundMethod.bind = function(newThis) {
+ for (
+ var _len = arguments.length,
+ args = Array(_len > 1 ? _len - 1 : 0),
+ _key = 1;
+ _key < _len;
+ _key++
+ ) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ // User is trying to bind() an autobound method; we effectively will
+ // ignore the value of "this" that the user is trying to use, so
+ // let's warn.
+ if (newThis !== component && newThis !== null) {
+ if ("development" !== 'production') {
+ warning(
+ false,
+ 'bind(): React component methods may only be bound to the ' +
+ 'component instance. See %s',
+ componentName
+ );
+ }
+ } else if (!args.length) {
+ if ("development" !== 'production') {
+ warning(
+ false,
+ 'bind(): You are binding a component method to the component. ' +
+ 'React does this for you automatically in a high-performance ' +
+ 'way, so you can safely remove this call. See %s',
+ componentName
+ );
+ }
+ return boundMethod;
+ }
+ var reboundMethod = _bind.apply(boundMethod, arguments);
+ reboundMethod.__reactBoundContext = component;
+ reboundMethod.__reactBoundMethod = method;
+ reboundMethod.__reactBoundArguments = args;
+ return reboundMethod;
+ };
+ }
+ return boundMethod;
+ }
+
+ /**
+ * Binds all auto-bound methods in a component.
+ *
+ * @param {object} component Component whose method is going to be bound.
+ */
+ function bindAutoBindMethods(component) {
+ var pairs = component.__reactAutoBindPairs;
+ for (var i = 0; i < pairs.length; i += 2) {
+ var autoBindKey = pairs[i];
+ var method = pairs[i + 1];
+ component[autoBindKey] = bindAutoBindMethod(component, method);
+ }
+ }
+
+ var IsMountedPreMixin = {
+ componentDidMount: function() {
+ this.__isMounted = true;
+ }
+ };
+
+ var IsMountedPostMixin = {
+ componentWillUnmount: function() {
+ this.__isMounted = false;
+ }
+ };
+
+ /**
+ * Add more to the ReactClass base class. These are all legacy features and
+ * therefore not already part of the modern ReactComponent.
+ */
+ var ReactClassMixin = {
+ /**
+ * TODO: This will be deprecated because state should always keep a consistent
+ * type signature and the only use case for this, is to avoid that.
+ */
+ replaceState: function(newState, callback) {
+ this.updater.enqueueReplaceState(this, newState, callback);
+ },
+
+ /**
+ * Checks whether or not this composite component is mounted.
+ * @return {boolean} True if mounted, false otherwise.
+ * @protected
+ * @final
+ */
+ isMounted: function() {
+ if ("development" !== 'production') {
+ warning(
+ this.__didWarnIsMounted,
+ '%s: isMounted is deprecated. Instead, make sure to clean up ' +
+ 'subscriptions and pending requests in componentWillUnmount to ' +
+ 'prevent memory leaks.',
+ (this.constructor && this.constructor.displayName) ||
+ this.name ||
+ 'Component'
+ );
+ this.__didWarnIsMounted = true;
+ }
+ return !!this.__isMounted;
+ }
+ };
+
+ var ReactClassComponent = function() {};
+ _assign(
+ ReactClassComponent.prototype,
+ ReactComponent.prototype,
+ ReactClassMixin
+ );
+
+ /**
+ * Creates a composite component class given a class specification.
+ * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
+ *
+ * @param {object} spec Class specification (which must define `render`).
+ * @return {function} Component constructor function.
+ * @public
+ */
+ function createClass(spec) {
+ // To keep our warnings more understandable, we'll use a little hack here to
+ // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
+ // unnecessarily identify a class without displayName as 'Constructor'.
+ var Constructor = identity(function(props, context, updater) {
+ // This constructor gets overridden by mocks. The argument is used
+ // by mocks to assert on what gets mounted.
+
+ if ("development" !== 'production') {
+ warning(
+ this instanceof Constructor,
+ 'Something is calling a React component directly. Use a factory or ' +
+ 'JSX instead. See: https://fb.me/react-legacyfactory'
+ );
+ }
+
+ // Wire up auto-binding
+ if (this.__reactAutoBindPairs.length) {
+ bindAutoBindMethods(this);
+ }
+
+ this.props = props;
+ this.context = context;
+ this.refs = emptyObject;
+ this.updater = updater || ReactNoopUpdateQueue;
+
+ this.state = null;
+
+ // ReactClasses doesn't have constructors. Instead, they use the
+ // getInitialState and componentWillMount methods for initialization.
+
+ var initialState = this.getInitialState ? this.getInitialState() : null;
+ if ("development" !== 'production') {
+ // We allow auto-mocks to proceed as if they're returning null.
+ if (
+ initialState === undefined &&
+ this.getInitialState._isMockFunction
+ ) {
+ // This is probably bad practice. Consider warning here and
+ // deprecating this convenience.
+ initialState = null;
+ }
+ }
+ _invariant(
+ typeof initialState === 'object' && !Array.isArray(initialState),
+ '%s.getInitialState(): must return an object or null',
+ Constructor.displayName || 'ReactCompositeComponent'
+ );
+
+ this.state = initialState;
+ });
+ Constructor.prototype = new ReactClassComponent();
+ Constructor.prototype.constructor = Constructor;
+ Constructor.prototype.__reactAutoBindPairs = [];
+
+ injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
+
+ mixSpecIntoComponent(Constructor, IsMountedPreMixin);
+ mixSpecIntoComponent(Constructor, spec);
+ mixSpecIntoComponent(Constructor, IsMountedPostMixin);
+
+ // Initialize the defaultProps property after all mixins have been merged.
+ if (Constructor.getDefaultProps) {
+ Constructor.defaultProps = Constructor.getDefaultProps();
+ }
+
+ if ("development" !== 'production') {
+ // This is a tag to indicate that the use of these method names is ok,
+ // since it's used with createClass. If it's not, then it's likely a
+ // mistake so we'll warn you to use the static property, property
+ // initializer or constructor respectively.
+ if (Constructor.getDefaultProps) {
+ Constructor.getDefaultProps.isReactClassApproved = {};
+ }
+ if (Constructor.prototype.getInitialState) {
+ Constructor.prototype.getInitialState.isReactClassApproved = {};
+ }
+ }
+
+ _invariant(
+ Constructor.prototype.render,
+ 'createClass(...): Class specification must implement a `render` method.'
+ );
+
+ if ("development" !== 'production') {
+ warning(
+ !Constructor.prototype.componentShouldUpdate,
+ '%s has a method called ' +
+ 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
+ 'The name is phrased as a question because the function is ' +
+ 'expected to return a value.',
+ spec.displayName || 'A component'
+ );
+ warning(
+ !Constructor.prototype.componentWillRecieveProps,
+ '%s has a method called ' +
+ 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
+ spec.displayName || 'A component'
+ );
+ }
+
+ // Reduce time spent doing lookups by setting these on the prototype.
+ for (var methodName in ReactClassInterface) {
+ if (!Constructor.prototype[methodName]) {
+ Constructor.prototype[methodName] = null;
+ }
+ }
+
+ return Constructor;
+ }
+
+ return createClass;
+}
+
+module.exports = factory;
+
+},{"29":29,"30":30,"31":31,"32":32}],28:[function(_dereq_,module,exports){
"use strict";
/**
@@ -3172,7 +3465,7 @@ emptyFunction.thatReturnsArgument = function (arg) {
};
module.exports = emptyFunction;
-},{}],28:[function(_dereq_,module,exports){
+},{}],29:[function(_dereq_,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
@@ -3192,7 +3485,7 @@ if ("development" !== 'production') {
}
module.exports = emptyObject;
-},{}],29:[function(_dereq_,module,exports){
+},{}],30:[function(_dereq_,module,exports){
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
@@ -3248,7 +3541,7 @@ function invariant(condition, format, a, b, c, d, e, f) {
}
module.exports = invariant;
-},{}],30:[function(_dereq_,module,exports){
+},{}],31:[function(_dereq_,module,exports){
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
@@ -3261,7 +3554,7 @@ module.exports = invariant;
'use strict';
-var emptyFunction = _dereq_(27);
+var emptyFunction = _dereq_(28);
/**
* Similar to invariant but only logs a warning if the condition is not met.
@@ -3315,7 +3608,7 @@ if ("development" !== 'production') {
}
module.exports = warning;
-},{"27":27}],31:[function(_dereq_,module,exports){
+},{"28":28}],32:[function(_dereq_,module,exports){
/*
object-assign
(c) Sindre Sorhus
@@ -3407,7 +3700,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
return to;
};
-},{}],32:[function(_dereq_,module,exports){
+},{}],33:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -3420,9 +3713,9 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
'use strict';
if ("development" !== 'production') {
- var invariant = _dereq_(29);
- var warning = _dereq_(30);
- var ReactPropTypesSecret = _dereq_(35);
+ var invariant = _dereq_(30);
+ var warning = _dereq_(31);
+ var ReactPropTypesSecret = _dereq_(36);
var loggedTypeFailures = {};
}
@@ -3470,7 +3763,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
module.exports = checkPropTypes;
-},{"29":29,"30":30,"35":35}],33:[function(_dereq_,module,exports){
+},{"30":30,"31":31,"36":36}],34:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -3486,14 +3779,14 @@ module.exports = checkPropTypes;
// Therefore we re-export development-only version with all the PropTypes checks here.
// However if one is migrating to the `prop-types` npm library, they will go through the
// `index.js` entry point, and it will branch depending on the environment.
-var factory = _dereq_(34);
+var factory = _dereq_(35);
module.exports = function(isValidElement) {
// It is still allowed in 15.5.
var throwOnDirectAccess = false;
return factory(isValidElement, throwOnDirectAccess);
};
-},{"34":34}],34:[function(_dereq_,module,exports){
+},{"35":35}],35:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -3505,12 +3798,12 @@ module.exports = function(isValidElement) {
'use strict';
-var emptyFunction = _dereq_(27);
-var invariant = _dereq_(29);
-var warning = _dereq_(30);
+var emptyFunction = _dereq_(28);
+var invariant = _dereq_(30);
+var warning = _dereq_(31);
-var ReactPropTypesSecret = _dereq_(35);
-var checkPropTypes = _dereq_(32);
+var ReactPropTypesSecret = _dereq_(36);
+var checkPropTypes = _dereq_(33);
module.exports = function(isValidElement, throwOnDirectAccess) {
/* global Symbol */
@@ -3644,6 +3937,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
function createChainableTypeChecker(validate) {
if ("development" !== 'production') {
var manualPropTypeCallCache = {};
+ var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
@@ -3661,7 +3955,11 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
} else if ("development" !== 'production' && typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
- if (!manualPropTypeCallCache[cacheKey]) {
+ if (
+ !manualPropTypeCallCache[cacheKey] &&
+ // Avoid spamming the console because they are often not actionable except for lib authors
+ manualPropTypeWarningCount < 3
+ ) {
warning(
false,
'You are manually calling a React.PropTypes validation ' +
@@ -3673,6 +3971,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
componentName
);
manualPropTypeCallCache[cacheKey] = true;
+ manualPropTypeWarningCount++;
}
}
}
@@ -3810,6 +4109,20 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
return emptyFunction.thatReturnsNull;
}
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
+ var checker = arrayOfTypeCheckers[i];
+ if (typeof checker !== 'function') {
+ warning(
+ false,
+ 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
+ 'received %s at index %s.',
+ getPostfixForTypeWarning(checker),
+ i
+ );
+ return emptyFunction.thatReturnsNull;
+ }
+ }
+
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
@@ -3942,6 +4255,9 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
// This handles more types than `getPropType`. Only used for error messages.
// See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) {
+ if (typeof propValue === 'undefined' || propValue === null) {
+ return '' + propValue;
+ }
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
@@ -3953,6 +4269,23 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
return propType;
}
+ // Returns a string that is postfixed to a warning about an invalid type.
+ // For example, "undefined" or "of type array"
+ function getPostfixForTypeWarning(value) {
+ var type = getPreciseType(value);
+ switch (type) {
+ case 'array':
+ case 'object':
+ return 'an ' + type;
+ case 'boolean':
+ case 'date':
+ case 'regexp':
+ return 'a ' + type;
+ default:
+ return type;
+ }
+ }
+
// Returns class name of the object, if any.
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
@@ -3967,7 +4300,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
return ReactPropTypes;
};
-},{"27":27,"29":29,"30":30,"32":32,"35":35}],35:[function(_dereq_,module,exports){
+},{"28":28,"30":30,"31":31,"33":33,"36":36}],36:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
@@ -3983,5 +4316,5 @@ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
module.exports = ReactPropTypesSecret;
-},{}]},{},[18])(18)
+},{}]},{},[16])(16)
}); \ No newline at end of file