react 16.0.0-alpha.0 → 16.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react.js +513 -475
- package/dist/react.min.js +7 -2
- package/lib/React.js +7 -18
- package/lib/{ReactComponent.js → ReactBaseClasses.js} +27 -2
- package/lib/ReactClass.js +10 -15
- package/lib/ReactComponentTreeHook.js +8 -47
- package/lib/ReactCurrentOwner.js +0 -2
- package/lib/ReactDebugCurrentFrame.js +55 -0
- package/lib/ReactElementValidator.js +40 -24
- package/lib/ReactFiberComponentTreeHook.js +62 -0
- package/lib/ReactNoopUpdateQueue.js +1 -2
- package/lib/ReactPropTypes.js +31 -29
- package/lib/{ReactPropTypeLocations.js → ReactPropTypesSecret.js} +5 -1
- package/lib/ReactVersion.js +1 -1
- package/lib/checkPropTypes.js +64 -0
- package/lib/checkReactTypeSpec.js +5 -80
- package/lib/deprecated.js +1 -1
- package/lib/traverseAllChildren.js +17 -28
- package/package.json +2 -2
- package/dist/react-with-addons.js +0 -5307
- package/dist/react-with-addons.min.js +0 -12
- package/lib/ReactAddonsDOMDependencies.js +0 -36
- package/lib/ReactAddonsDOMDependenciesUMDShim.js +0 -35
- package/lib/ReactCSSTransitionGroup.js +0 -104
- package/lib/ReactCSSTransitionGroupChild.js +0 -166
- package/lib/ReactComponentWithPureRenderMixin.js +0 -47
- package/lib/ReactFragment.js +0 -68
- package/lib/ReactPropTypeLocationNames.js +0 -24
- package/lib/ReactPureComponent.js +0 -41
- package/lib/ReactStateSetters.js +0 -103
- package/lib/ReactTransitionChildMapping.js +0 -102
- package/lib/ReactTransitionEvents.js +0 -72
- package/lib/ReactTransitionGroup.js +0 -228
- package/lib/ReactWithAddons.js +0 -50
- package/lib/ReactWithAddonsUMDEntry.js +0 -32
- package/lib/shallowCompare.js +0 -24
- package/lib/sliceChildren.js +0 -33
- package/lib/update.js +0 -111
package/dist/react.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React v16.0.0-alpha.
|
|
2
|
+
* React v16.0.0-alpha.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright 2013-present, Facebook, Inc.
|
|
5
5
|
* All rights reserved.
|
|
@@ -9,4 +9,9 @@
|
|
|
9
9
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.React=t()}}(function(){return function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){"use strict";function r(t){var e=/[=:]/g,n={"=":"=0",":":"=2"},r=(""+t).replace(e,function(t){return n[t]});return"$"+r}function o(t){var e=/(=0|=2)/g,n={"=0":"=","=2":":"},r="."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1);return(""+r).replace(e,function(t){return n[t]})}var i={escape:r,unescape:o};e.exports=i},{}],2:[function(t,e,n){"use strict";var r=t(20),o=(t(24),function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)}),i=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},a=function(t,e,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,t,e,n),o}return new r(t,e,n)},u=function(t,e,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,t,e,n,r),i}return new o(t,e,n,r)},s=function(t){var e=this;t instanceof e?void 0:r("25"),t.destructor(),e.instancePool.length<e.poolSize&&e.instancePool.push(t)},c=10,l=o,p=function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||l,n.poolSize||(n.poolSize=c),n.release=s,n},f={addPoolingTo:p,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fourArgumentPooler:u};e.exports=f},{20:20,24:24}],3:[function(t,e,n){"use strict";var r=t(26),o=t(4),i=t(6),a=t(14),u=t(5),s=t(8),c=t(9),l=t(13),p=t(16),f=t(19),d=(t(25),c.createElement),h=c.createFactory,y=c.cloneElement,v=r,m=function(t){return t},g={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:f},Component:i,PureComponent:a,createElement:d,cloneElement:y,isValidElement:c.isValidElement,PropTypes:l,createClass:u.createClass,createFactory:h,createMixin:m,DOM:s,version:p,__spread:v};e.exports=g},{13:13,14:14,16:16,19:19,25:25,26:26,4:4,5:5,6:6,8:8,9:9}],4:[function(t,e,n){"use strict";function r(t){return(""+t).replace(E,"$&/")}function o(t,e){this.func=t,this.context=e,this.count=0}function i(t,e,n){var r=t.func,o=t.context;r.call(o,e,t.count++)}function a(t,e,n){if(null==t)return t;var r=o.getPooled(e,n);m(t,i,r),o.release(r)}function u(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function s(t,e,n){var o=t.result,i=t.keyPrefix,a=t.func,u=t.context,s=a.call(u,e,t.count++);Array.isArray(s)?c(s,o,n,v.thatReturnsArgument):null!=s&&(y.isValidElement(s)&&(s=y.cloneAndReplaceKey(s,i+(!s.key||e&&e.key===s.key?"":r(s.key)+"/")+n)),o.push(s))}function c(t,e,n,o,i){var a="";null!=n&&(a=r(n)+"/");var c=u.getPooled(e,a,o,i);m(t,s,c),u.release(c)}function l(t,e,n){if(null==t)return t;var r=[];return c(t,r,null,e,n),r}function p(t,e,n){return null}function f(t,e){return m(t,p,null)}function d(t){var e=[];return c(t,e,null,v.thatReturnsArgument),e}var h=t(2),y=t(9),v=t(22),m=t(21),g=h.twoArgumentPooler,b=h.fourArgumentPooler,E=/\/+/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(o,g),u.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(u,b);var _={forEach:a,map:l,mapIntoWithKeyPrefixInternal:c,count:f,toArray:d};e.exports=_},{2:2,21:21,22:22,9:9}],5:[function(t,e,n){"use strict";function r(t){return t}function o(t,e){var n=b.hasOwnProperty(e)?b[e]:null;_.hasOwnProperty(e)&&("OVERRIDE_BASE"!==n?f("73",e):void 0),t&&("DEFINE_MANY"!==n&&"DEFINE_MANY_MERGED"!==n?f("74",e):void 0)}function i(t,e){if(e){"function"==typeof e?f("75"):void 0,y.isValidElement(e)?f("76"):void 0;var n=t.prototype,r=n.__reactAutoBindPairs;e.hasOwnProperty(g)&&E.mixins(t,e.mixins);for(var i in e)if(e.hasOwnProperty(i)&&i!==g){var a=e[i],u=n.hasOwnProperty(i);if(o(u,i),E.hasOwnProperty(i))E[i](t,a);else{var l=b.hasOwnProperty(i),p="function"==typeof a,d=p&&!l&&!u&&e.autobind!==!1;if(d)r.push(i,a),n[i]=a;else if(u){var h=b[i];!l||"DEFINE_MANY_MERGED"!==h&&"DEFINE_MANY"!==h?f("77",h,i):void 0,"DEFINE_MANY_MERGED"===h?n[i]=s(n[i],a):"DEFINE_MANY"===h&&(n[i]=c(n[i],a))}else n[i]=a}}}}function a(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var o=n in E;o?f("78",n):void 0;var i=n in t;i?f("79",n):void 0,t[n]=r}}}function u(t,e){t&&e&&"object"==typeof t&&"object"==typeof e?void 0:f("80");for(var n in e)e.hasOwnProperty(n)&&(void 0!==t[n]?f("81",n):void 0,t[n]=e[n]);return t}function s(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return u(o,n),u(o,r),o}}function c(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function l(t,e){var n=e.bind(t);return n}function p(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];t[r]=l(t,o)}}var f=t(20),d=t(26),h=t(6),y=t(9),v=(t(12),t(11)),m=t(23),g=(t(24),t(25),"mixins"),b={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},E={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)i(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=d({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=d({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=s(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=d({},t.propTypes,e)},statics:function(t,e){a(t,e)},autobind:function(){}},_={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e,"replaceState")},isMounted:function(){return this.updater.isMounted(this)}},P=function(){};d(P.prototype,h.prototype,_);var x={createClass:function(t){var e=r(function(t,n,r){this.__reactAutoBindPairs.length&&p(this),this.props=t,this.context=n,this.refs=m,this.updater=r||v,this.state=null;var o=this.getInitialState?this.getInitialState():null;"object"!=typeof o||Array.isArray(o)?f("82",e.displayName||"ReactCompositeComponent"):void 0,this.state=o});e.prototype=new P,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],i(e,t),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),e.prototype.render?void 0:f("83");for(var n in b)e.prototype[n]||(e.prototype[n]=null);return e}};e.exports=x},{11:11,12:12,20:20,23:23,24:24,25:25,26:26,6:6,9:9}],6:[function(t,e,n){"use strict";function r(t,e,n){this.props=t,this.context=e,this.refs=a,this.updater=n||i}var o=t(20),i=t(11),a=(t(17),t(23));t(24),t(25);r.prototype.isReactComponent={},r.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t?o("85"):void 0,this.updater.enqueueSetState(this,t,e,"setState")},r.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};e.exports=r},{11:11,17:17,20:20,23:23,24:24,25:25}],7:[function(t,e,n){"use strict";var r={current:null};e.exports=r},{}],8:[function(t,e,n){"use strict";var r=t(9),o=r.createFactory,i={a:o("a"),abbr:o("abbr"),address:o("address"),area:o("area"),article:o("article"),aside:o("aside"),audio:o("audio"),b:o("b"),base:o("base"),bdi:o("bdi"),bdo:o("bdo"),big:o("big"),blockquote:o("blockquote"),body:o("body"),br:o("br"),button:o("button"),canvas:o("canvas"),caption:o("caption"),cite:o("cite"),code:o("code"),col:o("col"),colgroup:o("colgroup"),data:o("data"),datalist:o("datalist"),dd:o("dd"),del:o("del"),details:o("details"),dfn:o("dfn"),dialog:o("dialog"),div:o("div"),dl:o("dl"),dt:o("dt"),em:o("em"),embed:o("embed"),fieldset:o("fieldset"),figcaption:o("figcaption"),figure:o("figure"),footer:o("footer"),form:o("form"),h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),head:o("head"),header:o("header"),hgroup:o("hgroup"),hr:o("hr"),html:o("html"),i:o("i"),iframe:o("iframe"),img:o("img"),input:o("input"),ins:o("ins"),kbd:o("kbd"),keygen:o("keygen"),label:o("label"),legend:o("legend"),li:o("li"),link:o("link"),main:o("main"),map:o("map"),mark:o("mark"),menu:o("menu"),menuitem:o("menuitem"),meta:o("meta"),meter:o("meter"),nav:o("nav"),noscript:o("noscript"),object:o("object"),ol:o("ol"),optgroup:o("optgroup"),option:o("option"),output:o("output"),p:o("p"),param:o("param"),picture:o("picture"),pre:o("pre"),progress:o("progress"),q:o("q"),rp:o("rp"),rt:o("rt"),ruby:o("ruby"),s:o("s"),samp:o("samp"),script:o("script"),section:o("section"),select:o("select"),small:o("small"),source:o("source"),span:o("span"),strong:o("strong"),style:o("style"),sub:o("sub"),summary:o("summary"),sup:o("sup"),table:o("table"),tbody:o("tbody"),td:o("td"),textarea:o("textarea"),tfoot:o("tfoot"),th:o("th"),thead:o("thead"),time:o("time"),title:o("title"),tr:o("tr"),track:o("track"),u:o("u"),ul:o("ul"),var:o("var"),video:o("video"),wbr:o("wbr"),circle:o("circle"),clipPath:o("clipPath"),defs:o("defs"),ellipse:o("ellipse"),g:o("g"),image:o("image"),line:o("line"),linearGradient:o("linearGradient"),mask:o("mask"),path:o("path"),pattern:o("pattern"),polygon:o("polygon"),polyline:o("polyline"),radialGradient:o("radialGradient"),rect:o("rect"),stop:o("stop"),svg:o("svg"),text:o("text"),tspan:o("tspan")};e.exports=i},{9:9}],9:[function(t,e,n){"use strict";function r(t){return void 0!==t.ref}function o(t){return void 0!==t.key}var i=t(26),a=t(7),u=(t(25),t(17),Object.prototype.hasOwnProperty),s=t(10),c={key:!0,ref:!0,__self:!0,__source:!0},l=function(t,e,n,r,o,i,a){var u={$$typeof:s,type:t,key:e,ref:n,props:a,_owner:i};return u};l.createElement=function(t,e,n){var i,s={},p=null,f=null,d=null,h=null;if(null!=e){r(e)&&(f=e.ref),o(e)&&(p=""+e.key),d=void 0===e.__self?null:e.__self,h=void 0===e.__source?null:e.__source;for(i in e)u.call(e,i)&&!c.hasOwnProperty(i)&&(s[i]=e[i])}var y=arguments.length-2;if(1===y)s.children=n;else if(y>1){for(var v=Array(y),m=0;m<y;m++)v[m]=arguments[m+2];s.children=v}if(t&&t.defaultProps){var g=t.defaultProps;for(i in g)void 0===s[i]&&(s[i]=g[i])}return l(t,p,f,d,h,a.current,s)},l.createFactory=function(t){var e=l.createElement.bind(null,t);return e.type=t,e},l.cloneAndReplaceKey=function(t,e){var n=l(t.type,e,t.ref,t._self,t._source,t._owner,t.props);return n},l.cloneElement=function(t,e,n){var s,p=i({},t.props),f=t.key,d=t.ref,h=t._self,y=t._source,v=t._owner;if(null!=e){r(e)&&(d=e.ref,v=a.current),o(e)&&(f=""+e.key);var m;t.type&&t.type.defaultProps&&(m=t.type.defaultProps);for(s in e)u.call(e,s)&&!c.hasOwnProperty(s)&&(void 0===e[s]&&void 0!==m?p[s]=m[s]:p[s]=e[s])}var g=arguments.length-2;if(1===g)p.children=n;else if(g>1){for(var b=Array(g),E=0;E<g;E++)b[E]=arguments[E+2];p.children=b}return l(t.type,f,d,h,y,v,p)},l.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===s},e.exports=l},{10:10,17:17,25:25,26:26,7:7}],10:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},{}],11:[function(t,e,n){"use strict";function r(t,e){}var o=(t(25),{isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,n){r(t,"forceUpdate")},enqueueReplaceState:function(t,e,n,o){r(t,"replaceState")},enqueueSetState:function(t,e,n,o){r(t,"setState")}});e.exports=o},{25:25}],12:[function(t,e,n){"use strict";var r={};e.exports=r},{}],13:[function(t,e,n){"use strict";function r(t){this.message=t,this.stack=""}var o,i=(t(20),t(9),t(12),t(22),t(18),t(24)),a=(t(25),function(){i(!1,"React.PropTypes type checking code is stripped in production.")});a.isRequired=a;var u=function(){return a};o={array:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:u,element:a,instanceOf:u,node:a,objectOf:u,oneOf:u,oneOfType:u,shape:u},r.prototype=Error.prototype,e.exports=o},{12:12,18:18,20:20,22:22,24:24,25:25,9:9}],14:[function(t,e,n){"use strict";function r(t,e,n){this.props=t,this.context=e,this.refs=s,this.updater=n||u}function o(){}var i=t(26),a=t(6),u=t(11),s=t(23);o.prototype=a.prototype,r.prototype=new o,r.prototype.constructor=r,i(r.prototype,a.prototype),r.prototype.isPureReactComponent=!0,e.exports=r},{11:11,23:23,26:26,6:6}],15:[function(t,e,n){"use strict";var r=t(26),o=t(3),i=r({__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:t(7)}},o);e.exports=i},{26:26,3:3,7:7}],16:[function(t,e,n){"use strict";e.exports="16.0.0-alpha.0"},{}],17:[function(t,e,n){"use strict";var r=!1;e.exports=r},{}],18:[function(t,e,n){"use strict";function r(t){var e=t&&(o&&t[o]||t[i]);if("function"==typeof e)return e}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=r},{}],19:[function(t,e,n){"use strict";function r(t){return i.isValidElement(t)?void 0:o("143"),t}var o=t(20),i=t(9);t(24);e.exports=r},{20:20,24:24,9:9}],20:[function(t,e,n){"use strict";function r(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}e.exports=r},{}],21:[function(t,e,n){"use strict";function r(t,e){return t&&"object"==typeof t&&null!=t.key?c.escape(t.key):e.toString(36)}function o(t,e,n,i){var f=typeof t;if("undefined"!==f&&"boolean"!==f||(t=null),null===t||"string"===f||"number"===f||"object"===f&&t.$$typeof===u)return n(i,t,""===e?l+r(t,0):e),1;var d,h,y=0,v=""===e?l:e+p;if(Array.isArray(t))for(var m=0;m<t.length;m++)d=t[m],h=v+r(d,m),y+=o(d,h,n,i);else{var g=s(t);if(g){var b,E=g.call(t);if(g!==t.entries)for(var _=0;!(b=E.next()).done;)d=b.value,h=v+r(d,_++),y+=o(d,h,n,i);else for(;!(b=E.next()).done;){var P=b.value;P&&(d=P[1],h=v+c.escape(P[0])+p+r(d,0),y+=o(d,h,n,i))}}else if("object"===f){var x="",N=String(t);a("31","[object Object]"===N?"object with keys {"+Object.keys(t).join(", ")+"}":N,x)}}return y}function i(t,e,n){return null==t?0:o(t,"",e,n)}var a=t(20),u=(t(7),t(10)),s=t(18),c=(t(24),t(1)),l=(t(25),"."),p=":";e.exports=i},{1:1,10:10,18:18,20:20,24:24,25:25,7:7}],22:[function(t,e,n){"use strict";function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},e.exports=o},{}],23:[function(t,e,n){"use strict";var r={};e.exports=r},{}],24:[function(t,e,n){"use strict";function r(t,e,n,r,o,i,a,u){if(!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,u],l=0;s=new Error(e.replace(/%s/g,function(){return c[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}e.exports=r},{}],25:[function(t,e,n){"use strict";var r=t(22),o=r;e.exports=o},{22:22}],26:[function(t,e,n){"use strict";function r(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function o(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}var i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(t,e){for(var n,o,u=r(t),s=1;s<arguments.length;s++){n=Object(arguments[s]);for(var c in n)i.call(n,c)&&(u[c]=n[c]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(n);for(var l=0;l<o.length;l++)a.call(n,o[l])&&(u[o[l]]=n[o[l]])}}return u}},{}]},{},[15])(15)});
|
|
12
|
+
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.React=t()}}(function(){return function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){"use strict";function r(t){var e=/[=:]/g,n={"=":"=0",":":"=2"},r=(""+t).replace(e,function(t){return n[t]});return"$"+r}function o(t){var e=/(=0|=2)/g,n={"=0":"=","=2":":"},r="."===t[0]&&"$"===t[1]?t.substring(2):t.substring(1);return(""+r).replace(e,function(t){return n[t]})}var i={escape:r,unescape:o};e.exports=i},{}],2:[function(t,e,n){"use strict";var r=t(20),o=(t(24),function(t){var e=this;if(e.instancePool.length){var n=e.instancePool.pop();return e.call(n,t),n}return new e(t)}),i=function(t,e){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,t,e),r}return new n(t,e)},a=function(t,e,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,t,e,n),o}return new r(t,e,n)},u=function(t,e,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,t,e,n,r),i}return new o(t,e,n,r)},s=function(t){var e=this;t instanceof e?void 0:r("25"),t.destructor(),e.instancePool.length<e.poolSize&&e.instancePool.push(t)},c=10,l=o,p=function(t,e){var n=t;return n.instancePool=[],n.getPooled=e||l,n.poolSize||(n.poolSize=c),n.release=s,n},f={addPoolingTo:p,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:a,fourArgumentPooler:u};e.exports=f},{20:20,24:24}],3:[function(t,e,n){"use strict";var r=t(4),o=t(5),i=t(6),a=t(8),u=t(9),s=t(12),c=t(15),l=t(19),p=(t(25),t(17)),f=u.createElement,d=u.createFactory,h=u.cloneElement,y=function(t){return t},v={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:l},Component:r.Component,PureComponent:r.PureComponent,createElement:f,cloneElement:h,isValidElement:u.isValidElement,checkPropTypes:p,PropTypes:s,createClass:i.createClass,createFactory:d,createMixin:y,DOM:a,version:c};e.exports=v},{12:12,15:15,17:17,19:19,25:25,4:4,5:5,6:6,8:8,9:9}],4:[function(t,e,n){"use strict";function r(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||s}function o(t,e,n){this.props=t,this.context=e,this.refs=c,this.updater=n||s}function i(){}var a=t(20),u=t(26),s=t(11),c=(t(16),t(23));t(24),t(25);r.prototype.isReactComponent={},r.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t?a("85"):void 0,this.updater.enqueueSetState(this,t,e,"setState")},r.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};i.prototype=r.prototype,o.prototype=new i,o.prototype.constructor=o,u(o.prototype,r.prototype),o.prototype.isPureReactComponent=!0,e.exports={Component:r,PureComponent:o}},{11:11,16:16,20:20,23:23,24:24,25:25,26:26}],5:[function(t,e,n){"use strict";function r(t){return(""+t).replace(b,"$&/")}function o(t,e){this.func=t,this.context=e,this.count=0}function i(t,e,n){var r=t.func,o=t.context;r.call(o,e,t.count++)}function a(t,e,n){if(null==t)return t;var r=o.getPooled(e,n);m(t,i,r),o.release(r)}function u(t,e,n,r){this.result=t,this.keyPrefix=e,this.func=n,this.context=r,this.count=0}function s(t,e,n){var o=t.result,i=t.keyPrefix,a=t.func,u=t.context,s=a.call(u,e,t.count++);Array.isArray(s)?c(s,o,n,v.thatReturnsArgument):null!=s&&(y.isValidElement(s)&&(s=y.cloneAndReplaceKey(s,i+(!s.key||e&&e.key===s.key?"":r(s.key)+"/")+n)),o.push(s))}function c(t,e,n,o,i){var a="";null!=n&&(a=r(n)+"/");var c=u.getPooled(e,a,o,i);m(t,s,c),u.release(c)}function l(t,e,n){if(null==t)return t;var r=[];return c(t,r,null,e,n),r}function p(t,e,n){return null}function f(t,e){return m(t,p,null)}function d(t){var e=[];return c(t,e,null,v.thatReturnsArgument),e}var h=t(2),y=t(9),v=t(22),m=t(21),g=h.twoArgumentPooler,E=h.fourArgumentPooler,b=/\/+/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(o,g),u.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(u,E);var _={forEach:a,map:l,mapIntoWithKeyPrefixInternal:c,count:f,toArray:d};e.exports=_},{2:2,21:21,22:22,9:9}],6:[function(t,e,n){"use strict";function r(t){return t}function o(t,e){var n=b.hasOwnProperty(e)?b[e]:null;P.hasOwnProperty(e)&&("OVERRIDE_BASE"!==n?d("73",e):void 0),t&&("DEFINE_MANY"!==n&&"DEFINE_MANY_MERGED"!==n?d("74",e):void 0)}function i(t,e){if(e){"function"==typeof e?d("75"):void 0,y.isValidElement(e)?d("76"):void 0;var n=t.prototype,r=n.__reactAutoBindPairs;e.hasOwnProperty(E)&&_.mixins(t,e.mixins);for(var i in e)if(e.hasOwnProperty(i)&&i!==E){var a=e[i],u=n.hasOwnProperty(i);if(o(u,i),_.hasOwnProperty(i))_[i](t,a);else{var l=b.hasOwnProperty(i),p="function"==typeof a,f=p&&!l&&!u&&e.autobind!==!1;if(f)r.push(i,a),n[i]=a;else if(u){var h=b[i];!l||"DEFINE_MANY_MERGED"!==h&&"DEFINE_MANY"!==h?d("77",h,i):void 0,"DEFINE_MANY_MERGED"===h?n[i]=s(n[i],a):"DEFINE_MANY"===h&&(n[i]=c(n[i],a))}else n[i]=a}}}}function a(t,e){if(e)for(var n in e){var r=e[n];if(e.hasOwnProperty(n)){var o=n in _;o?d("78",n):void 0;var i=n in t;i?d("79",n):void 0,t[n]=r}}}function u(t,e){t&&e&&"object"==typeof t&&"object"==typeof e?void 0:d("80");for(var n in e)e.hasOwnProperty(n)&&(void 0!==t[n]?d("81",n):void 0,t[n]=e[n]);return t}function s(t,e){return function(){var n=t.apply(this,arguments),r=e.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return u(o,n),u(o,r),o}}function c(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function l(t,e){var n=e.bind(t);return n}function p(t){for(var e=t.__reactAutoBindPairs,n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];t[r]=l(t,o)}}var f=t(26),d=t(20),h=t(4),y=t(9),v=t(11),m=t(23),g=(t(24),t(25),h.Component),E="mixins",b={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},_={displayName:function(t,e){t.displayName=e},mixins:function(t,e){if(e)for(var n=0;n<e.length;n++)i(t,e[n])},childContextTypes:function(t,e){t.childContextTypes=f({},t.childContextTypes,e)},contextTypes:function(t,e){t.contextTypes=f({},t.contextTypes,e)},getDefaultProps:function(t,e){t.getDefaultProps?t.getDefaultProps=s(t.getDefaultProps,e):t.getDefaultProps=e},propTypes:function(t,e){t.propTypes=f({},t.propTypes,e)},statics:function(t,e){a(t,e)},autobind:function(){}},P={replaceState:function(t,e){this.updater.enqueueReplaceState(this,t,e,"replaceState")},isMounted:function(){return this.updater.isMounted(this)}},x=function(){};f(x.prototype,g.prototype,P);var N={createClass:function(t){var e=r(function(t,n,r){this.__reactAutoBindPairs.length&&p(this),this.props=t,this.context=n,this.refs=m,this.updater=r||v,this.state=null;var o=this.getInitialState?this.getInitialState():null;"object"!=typeof o||Array.isArray(o)?d("82",e.displayName||"ReactCompositeComponent"):void 0,this.state=o});e.prototype=new x,e.prototype.constructor=e,e.prototype.__reactAutoBindPairs=[],i(e,t),e.getDefaultProps&&(e.defaultProps=e.getDefaultProps()),e.prototype.render?void 0:d("83");for(var n in b)e.prototype[n]||(e.prototype[n]=null);return e}};e.exports=N},{11:11,20:20,23:23,24:24,25:25,26:26,4:4,9:9}],7:[function(t,e,n){"use strict";var r={current:null};e.exports=r},{}],8:[function(t,e,n){"use strict";var r=t(9),o=r.createFactory,i={a:o("a"),abbr:o("abbr"),address:o("address"),area:o("area"),article:o("article"),aside:o("aside"),audio:o("audio"),b:o("b"),base:o("base"),bdi:o("bdi"),bdo:o("bdo"),big:o("big"),blockquote:o("blockquote"),body:o("body"),br:o("br"),button:o("button"),canvas:o("canvas"),caption:o("caption"),cite:o("cite"),code:o("code"),col:o("col"),colgroup:o("colgroup"),data:o("data"),datalist:o("datalist"),dd:o("dd"),del:o("del"),details:o("details"),dfn:o("dfn"),dialog:o("dialog"),div:o("div"),dl:o("dl"),dt:o("dt"),em:o("em"),embed:o("embed"),fieldset:o("fieldset"),figcaption:o("figcaption"),figure:o("figure"),footer:o("footer"),form:o("form"),h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),head:o("head"),header:o("header"),hgroup:o("hgroup"),hr:o("hr"),html:o("html"),i:o("i"),iframe:o("iframe"),img:o("img"),input:o("input"),ins:o("ins"),kbd:o("kbd"),keygen:o("keygen"),label:o("label"),legend:o("legend"),li:o("li"),link:o("link"),main:o("main"),map:o("map"),mark:o("mark"),menu:o("menu"),menuitem:o("menuitem"),meta:o("meta"),meter:o("meter"),nav:o("nav"),noscript:o("noscript"),object:o("object"),ol:o("ol"),optgroup:o("optgroup"),option:o("option"),output:o("output"),p:o("p"),param:o("param"),picture:o("picture"),pre:o("pre"),progress:o("progress"),q:o("q"),rp:o("rp"),rt:o("rt"),ruby:o("ruby"),s:o("s"),samp:o("samp"),script:o("script"),section:o("section"),select:o("select"),small:o("small"),source:o("source"),span:o("span"),strong:o("strong"),style:o("style"),sub:o("sub"),summary:o("summary"),sup:o("sup"),table:o("table"),tbody:o("tbody"),td:o("td"),textarea:o("textarea"),tfoot:o("tfoot"),th:o("th"),thead:o("thead"),time:o("time"),title:o("title"),tr:o("tr"),track:o("track"),u:o("u"),ul:o("ul"),var:o("var"),video:o("video"),wbr:o("wbr"),circle:o("circle"),clipPath:o("clipPath"),defs:o("defs"),ellipse:o("ellipse"),g:o("g"),image:o("image"),line:o("line"),linearGradient:o("linearGradient"),mask:o("mask"),path:o("path"),pattern:o("pattern"),polygon:o("polygon"),polyline:o("polyline"),radialGradient:o("radialGradient"),rect:o("rect"),stop:o("stop"),svg:o("svg"),text:o("text"),tspan:o("tspan")};e.exports=i},{9:9}],9:[function(t,e,n){"use strict";function r(t){return void 0!==t.ref}function o(t){return void 0!==t.key}var i=t(26),a=t(7),u=(t(25),t(16),Object.prototype.hasOwnProperty),s=t(10),c={key:!0,ref:!0,__self:!0,__source:!0},l=function(t,e,n,r,o,i,a){var u={$$typeof:s,type:t,key:e,ref:n,props:a,_owner:i};return u};l.createElement=function(t,e,n){var i,s={},p=null,f=null,d=null,h=null;if(null!=e){r(e)&&(f=e.ref),o(e)&&(p=""+e.key),d=void 0===e.__self?null:e.__self,h=void 0===e.__source?null:e.__source;for(i in e)u.call(e,i)&&!c.hasOwnProperty(i)&&(s[i]=e[i])}var y=arguments.length-2;if(1===y)s.children=n;else if(y>1){for(var v=Array(y),m=0;m<y;m++)v[m]=arguments[m+2];s.children=v}if(t&&t.defaultProps){var g=t.defaultProps;for(i in g)void 0===s[i]&&(s[i]=g[i])}return l(t,p,f,d,h,a.current,s)},l.createFactory=function(t){var e=l.createElement.bind(null,t);return e.type=t,e},l.cloneAndReplaceKey=function(t,e){var n=l(t.type,e,t.ref,t._self,t._source,t._owner,t.props);return n},l.cloneElement=function(t,e,n){var s,p=i({},t.props),f=t.key,d=t.ref,h=t._self,y=t._source,v=t._owner;if(null!=e){r(e)&&(d=e.ref,v=a.current),o(e)&&(f=""+e.key);var m;t.type&&t.type.defaultProps&&(m=t.type.defaultProps);for(s in e)u.call(e,s)&&!c.hasOwnProperty(s)&&(void 0===e[s]&&void 0!==m?p[s]=m[s]:p[s]=e[s])}var g=arguments.length-2;if(1===g)p.children=n;else if(g>1){for(var E=Array(g),b=0;b<g;b++)E[b]=arguments[b+2];p.children=E}return l(t.type,f,d,h,y,v,p)},l.isValidElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===s},e.exports=l},{10:10,16:16,25:25,26:26,7:7}],10:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},{}],11:[function(t,e,n){"use strict";function r(t,e){}var o=(t(25),{isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,n){r(t,"forceUpdate")},enqueueReplaceState:function(t,e,n,o){r(t,"replaceState")},enqueueSetState:function(t,e,n,o){r(t,"setState")}});e.exports=o},{25:25}],12:[function(t,e,n){"use strict";function r(t){this.message=t,this.stack=""}var o,i=t(20),a=(t(9),t(13),t(22),t(18),t(24),t(25),function(){i("144")});a.isRequired=a;var u=function(){return a};o={array:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:u,element:a,instanceOf:u,node:a,objectOf:u,oneOf:u,oneOfType:u,shape:u},r.prototype=Error.prototype,e.exports=o},{13:13,18:18,20:20,22:22,24:24,25:25,9:9}],13:[function(t,e,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=r},{}],14:[function(t,e,n){"use strict";var r=t(26),o=t(3),i=r({__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:t(7)}},o);e.exports=i},{26:26,3:3,7:7}],15:[function(t,e,n){"use strict";e.exports="16.0.0-alpha.5"},{}],16:[function(t,e,n){"use strict";var r=!1;e.exports=r},{}],17:[function(t,e,n){"use strict";function r(t,e,n,r,o){}t(20),t(13),t(24),t(25);e.exports=r},{13:13,20:20,24:24,25:25}],18:[function(t,e,n){"use strict";function r(t){var e=t&&(o&&t[o]||t[i]);if("function"==typeof e)return e}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=r},{}],19:[function(t,e,n){"use strict";function r(t){return i.isValidElement(t)?void 0:o("143"),t}var o=t(20),i=t(9);t(24);e.exports=r},{20:20,24:24,9:9}],20:[function(t,e,n){"use strict";function r(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}e.exports=r},{}],21:[function(t,e,n){"use strict";function r(t,e){return t&&"object"==typeof t&&null!=t.key?c.escape(t.key):e.toString(36)}function o(t,e,n,i){var c=typeof t;if("undefined"!==c&&"boolean"!==c||(t=null),null===t||"string"===c||"number"===c||"object"===c&&t.$$typeof===u)return n(i,t,""===e?l+r(t,0):e),1;var f,d,h=0,y=""===e?l:e+p;if(Array.isArray(t))for(var v=0;v<t.length;v++)f=t[v],d=y+r(f,v),h+=o(f,d,n,i);else{var m=s(t);if(m)for(var g,E=m.call(t),b=0;!(g=E.next()).done;)f=g.value,d=y+r(f,b++),h+=o(f,d,n,i);else if("object"===c){var _="",P=""+t;a("31","[object Object]"===P?"object with keys {"+Object.keys(t).join(", ")+"}":P,_)}}return h}function i(t,e,n){return null==t?0:o(t,"",e,n)}var a=t(20),u=(t(7),t(10)),s=t(18),c=(t(24),t(1)),l=(t(25),"."),p=":";e.exports=i},{1:1,10:10,18:18,20:20,24:24,25:25,7:7}],22:[function(t,e,n){"use strict";function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},e.exports=o},{}],23:[function(t,e,n){"use strict";var r={};e.exports=r},{}],24:[function(t,e,n){"use strict";function r(t,e,n,r,o,i,a,u){if(!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,u],l=0;s=new Error(e.replace(/%s/g,function(){return c[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}e.exports=r},{}],25:[function(t,e,n){"use strict";var r=t(22),o=r;e.exports=o},{22:22}],26:[function(t,e,n){/*
|
|
13
|
+
object-assign
|
|
14
|
+
(c) Sindre Sorhus
|
|
15
|
+
@license MIT
|
|
16
|
+
*/
|
|
17
|
+
"use strict";function r(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function o(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}var i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(t,e){for(var n,o,s=r(t),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var l in n)a.call(n,l)&&(s[l]=n[l]);if(i){o=i(n);for(var p=0;p<o.length;p++)u.call(n,o[p])&&(s[o[p]]=n[o[p]])}}return s}},{}]},{},[14])(14)});
|
package/lib/React.js
CHANGED
|
@@ -10,11 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
|
|
13
|
+
var ReactBaseClasses = require('./ReactBaseClasses');
|
|
15
14
|
var ReactChildren = require('./ReactChildren');
|
|
16
|
-
var ReactComponent = require('./ReactComponent');
|
|
17
|
-
var ReactPureComponent = require('./ReactPureComponent');
|
|
18
15
|
var ReactClass = require('./ReactClass');
|
|
19
16
|
var ReactDOMFactories = require('./ReactDOMFactories');
|
|
20
17
|
var ReactElement = require('./ReactElement');
|
|
@@ -23,6 +20,7 @@ var ReactVersion = require('./ReactVersion');
|
|
|
23
20
|
|
|
24
21
|
var onlyChild = require('./onlyChild');
|
|
25
22
|
var warning = require('fbjs/lib/warning');
|
|
23
|
+
var checkPropTypes = require('./checkPropTypes');
|
|
26
24
|
|
|
27
25
|
var createElement = ReactElement.createElement;
|
|
28
26
|
var createFactory = ReactElement.createFactory;
|
|
@@ -35,19 +33,12 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
35
33
|
cloneElement = ReactElementValidator.cloneElement;
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
var __spread = _assign;
|
|
39
36
|
var createMixin = function (mixin) {
|
|
40
37
|
return mixin;
|
|
41
38
|
};
|
|
42
39
|
|
|
43
40
|
if (process.env.NODE_ENV !== 'production') {
|
|
44
|
-
var warnedForSpread = false;
|
|
45
41
|
var warnedForCreateMixin = false;
|
|
46
|
-
__spread = function () {
|
|
47
|
-
process.env.NODE_ENV !== 'production' ? warning(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.') : void 0;
|
|
48
|
-
warnedForSpread = true;
|
|
49
|
-
return _assign.apply(null, arguments);
|
|
50
|
-
};
|
|
51
42
|
|
|
52
43
|
createMixin = function (mixin) {
|
|
53
44
|
process.env.NODE_ENV !== 'production' ? warning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. You ' + 'can use this mixin directly instead.') : void 0;
|
|
@@ -57,7 +48,6 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
57
48
|
}
|
|
58
49
|
|
|
59
50
|
var React = {
|
|
60
|
-
|
|
61
51
|
// Modern
|
|
62
52
|
|
|
63
53
|
Children: {
|
|
@@ -68,13 +58,15 @@ var React = {
|
|
|
68
58
|
only: onlyChild
|
|
69
59
|
},
|
|
70
60
|
|
|
71
|
-
Component:
|
|
72
|
-
PureComponent:
|
|
61
|
+
Component: ReactBaseClasses.Component,
|
|
62
|
+
PureComponent: ReactBaseClasses.PureComponent,
|
|
73
63
|
|
|
74
64
|
createElement: createElement,
|
|
75
65
|
cloneElement: cloneElement,
|
|
76
66
|
isValidElement: ReactElement.isValidElement,
|
|
77
67
|
|
|
68
|
+
checkPropTypes: checkPropTypes,
|
|
69
|
+
|
|
78
70
|
// Classic
|
|
79
71
|
|
|
80
72
|
PropTypes: ReactPropTypes,
|
|
@@ -86,10 +78,7 @@ var React = {
|
|
|
86
78
|
// since they are just generating DOM strings.
|
|
87
79
|
DOM: ReactDOMFactories,
|
|
88
80
|
|
|
89
|
-
version: ReactVersion
|
|
90
|
-
|
|
91
|
-
// Deprecated hook for JSX spread, don't use this for anything.
|
|
92
|
-
__spread: __spread
|
|
81
|
+
version: ReactVersion
|
|
93
82
|
};
|
|
94
83
|
|
|
95
84
|
module.exports = React;
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
var _prodInvariant = require('./reactProdInvariant')
|
|
13
|
+
var _prodInvariant = require('./reactProdInvariant'),
|
|
14
|
+
_assign = require('object-assign');
|
|
14
15
|
|
|
15
16
|
var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue');
|
|
16
17
|
|
|
@@ -108,4 +109,28 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Base class helpers for the updating state of a component.
|
|
114
|
+
*/
|
|
115
|
+
function ReactPureComponent(props, context, updater) {
|
|
116
|
+
// Duplicated from ReactComponent.
|
|
117
|
+
this.props = props;
|
|
118
|
+
this.context = context;
|
|
119
|
+
this.refs = emptyObject;
|
|
120
|
+
// We initialize the default updater but the real one gets injected by the
|
|
121
|
+
// renderer.
|
|
122
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function ComponentDummy() {}
|
|
126
|
+
ComponentDummy.prototype = ReactComponent.prototype;
|
|
127
|
+
ReactPureComponent.prototype = new ComponentDummy();
|
|
128
|
+
ReactPureComponent.prototype.constructor = ReactPureComponent;
|
|
129
|
+
// Avoid an extra prototype jump for these methods.
|
|
130
|
+
_assign(ReactPureComponent.prototype, ReactComponent.prototype);
|
|
131
|
+
ReactPureComponent.prototype.isPureReactComponent = true;
|
|
132
|
+
|
|
133
|
+
module.exports = {
|
|
134
|
+
Component: ReactComponent,
|
|
135
|
+
PureComponent: ReactPureComponent
|
|
136
|
+
};
|
package/lib/ReactClass.js
CHANGED
|
@@ -10,18 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
|
|
13
|
+
var _assign = require('object-assign'),
|
|
14
|
+
_prodInvariant = require('./reactProdInvariant');
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var ReactBaseClasses = require('./ReactBaseClasses');
|
|
17
17
|
var ReactElement = require('./ReactElement');
|
|
18
|
-
var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');
|
|
19
18
|
var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue');
|
|
20
19
|
|
|
21
20
|
var emptyObject = require('fbjs/lib/emptyObject');
|
|
22
21
|
var invariant = require('fbjs/lib/invariant');
|
|
23
22
|
var warning = require('fbjs/lib/warning');
|
|
24
23
|
|
|
24
|
+
var ReactComponent = ReactBaseClasses.Component;
|
|
25
|
+
|
|
25
26
|
var MIXINS_KEY = 'mixins';
|
|
26
27
|
|
|
27
28
|
// Helper function to allow the creation of anonymous functions which do not
|
|
@@ -58,7 +59,6 @@ function identity(fn) {
|
|
|
58
59
|
* @internal
|
|
59
60
|
*/
|
|
60
61
|
var ReactClassInterface = {
|
|
61
|
-
|
|
62
62
|
/**
|
|
63
63
|
* An array of Mixin objects to include when defining your component.
|
|
64
64
|
*
|
|
@@ -149,7 +149,6 @@ var ReactClassInterface = {
|
|
|
149
149
|
* }
|
|
150
150
|
*
|
|
151
151
|
* @return {ReactComponent}
|
|
152
|
-
* @nosideeffects
|
|
153
152
|
* @required
|
|
154
153
|
*/
|
|
155
154
|
render: 'DEFINE_ONCE',
|
|
@@ -277,7 +276,6 @@ var ReactClassInterface = {
|
|
|
277
276
|
* @overridable
|
|
278
277
|
*/
|
|
279
278
|
updateComponent: 'OVERRIDE_BASE'
|
|
280
|
-
|
|
281
279
|
};
|
|
282
280
|
|
|
283
281
|
/**
|
|
@@ -302,7 +300,7 @@ var RESERVED_SPEC_KEYS = {
|
|
|
302
300
|
},
|
|
303
301
|
childContextTypes: function (Constructor, childContextTypes) {
|
|
304
302
|
if (process.env.NODE_ENV !== 'production') {
|
|
305
|
-
validateTypeDef(Constructor, childContextTypes, '
|
|
303
|
+
validateTypeDef(Constructor, childContextTypes, 'child context');
|
|
306
304
|
}
|
|
307
305
|
Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
|
|
308
306
|
},
|
|
@@ -339,7 +337,7 @@ function validateTypeDef(Constructor, typeDef, location) {
|
|
|
339
337
|
if (typeDef.hasOwnProperty(propName)) {
|
|
340
338
|
// use a warning instead of an invariant so components
|
|
341
339
|
// don't show up in prod but only in __DEV__
|
|
342
|
-
process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass',
|
|
340
|
+
process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', location, propName) : void 0;
|
|
343
341
|
}
|
|
344
342
|
}
|
|
345
343
|
}
|
|
@@ -368,7 +366,7 @@ function mixSpecIntoComponent(Constructor, spec) {
|
|
|
368
366
|
var typeofSpec = typeof spec;
|
|
369
367
|
var isMixinValid = typeofSpec === 'object' && spec !== null;
|
|
370
368
|
|
|
371
|
-
process.env.NODE_ENV !== 'production' ? warning(isMixinValid,
|
|
369
|
+
process.env.NODE_ENV !== '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;
|
|
372
370
|
}
|
|
373
371
|
|
|
374
372
|
return;
|
|
@@ -545,9 +543,9 @@ function bindAutoBindMethod(component, method) {
|
|
|
545
543
|
// ignore the value of "this" that the user is trying to use, so
|
|
546
544
|
// let's warn.
|
|
547
545
|
if (newThis !== component && newThis !== null) {
|
|
548
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance
|
|
546
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance.\n\nSee %s', componentName) : void 0;
|
|
549
547
|
} else if (!args.length) {
|
|
550
|
-
process.env.NODE_ENV !== '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
|
|
548
|
+
process.env.NODE_ENV !== '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.\n\nSee %s', componentName) : void 0;
|
|
551
549
|
return boundMethod;
|
|
552
550
|
}
|
|
553
551
|
var reboundMethod = _bind.apply(boundMethod, arguments);
|
|
@@ -579,7 +577,6 @@ function bindAutoBindMethods(component) {
|
|
|
579
577
|
* therefore not already part of the modern ReactComponent.
|
|
580
578
|
*/
|
|
581
579
|
var ReactClassMixin = {
|
|
582
|
-
|
|
583
580
|
/**
|
|
584
581
|
* TODO: This will be deprecated because state should always keep a consistent
|
|
585
582
|
* type signature and the only use case for this, is to avoid that.
|
|
@@ -608,7 +605,6 @@ _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin
|
|
|
608
605
|
* @class ReactClass
|
|
609
606
|
*/
|
|
610
607
|
var ReactClass = {
|
|
611
|
-
|
|
612
608
|
/**
|
|
613
609
|
* Creates a composite component class given a class specification.
|
|
614
610
|
* See https://facebook.github.io/react/docs/react-api.html#createclass
|
|
@@ -697,7 +693,6 @@ var ReactClass = {
|
|
|
697
693
|
|
|
698
694
|
return Constructor;
|
|
699
695
|
}
|
|
700
|
-
|
|
701
696
|
};
|
|
702
697
|
|
|
703
698
|
module.exports = ReactClass;
|
|
@@ -14,16 +14,14 @@
|
|
|
14
14
|
var _prodInvariant = require('./reactProdInvariant');
|
|
15
15
|
|
|
16
16
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
17
|
-
var ReactTypeOfWork = require('./ReactTypeOfWork');
|
|
18
|
-
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
|
|
19
|
-
FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
|
|
20
|
-
ClassComponent = ReactTypeOfWork.ClassComponent,
|
|
21
|
-
HostComponent = ReactTypeOfWork.HostComponent;
|
|
22
17
|
|
|
18
|
+
var _require = require('./ReactFiberComponentTreeHook'),
|
|
19
|
+
getStackAddendumByWorkInProgressFiber = _require.getStackAddendumByWorkInProgressFiber,
|
|
20
|
+
describeComponentFrame = _require.describeComponentFrame;
|
|
23
21
|
|
|
24
|
-
var getComponentName = require('./getComponentName');
|
|
25
22
|
var invariant = require('fbjs/lib/invariant');
|
|
26
23
|
var warning = require('fbjs/lib/warning');
|
|
24
|
+
var getComponentName = require('./getComponentName');
|
|
27
25
|
|
|
28
26
|
function isNative(fn) {
|
|
29
27
|
// Based on isNative() from Lodash
|
|
@@ -144,10 +142,6 @@ function purgeDeep(id) {
|
|
|
144
142
|
}
|
|
145
143
|
}
|
|
146
144
|
|
|
147
|
-
function describeComponentFrame(name, source, ownerName) {
|
|
148
|
-
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
145
|
function getDisplayName(element) {
|
|
152
146
|
if (element == null) {
|
|
153
147
|
return '#empty';
|
|
@@ -164,31 +158,13 @@ function describeID(id) {
|
|
|
164
158
|
var name = ReactComponentTreeHook.getDisplayName(id);
|
|
165
159
|
var element = ReactComponentTreeHook.getElement(id);
|
|
166
160
|
var ownerID = ReactComponentTreeHook.getOwnerID(id);
|
|
167
|
-
var ownerName;
|
|
161
|
+
var ownerName = void 0;
|
|
162
|
+
|
|
168
163
|
if (ownerID) {
|
|
169
164
|
ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
|
|
170
165
|
}
|
|
171
166
|
process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
|
|
172
|
-
return describeComponentFrame(name, element && element._source, ownerName);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function describeFiber(fiber) {
|
|
176
|
-
switch (fiber.tag) {
|
|
177
|
-
case IndeterminateComponent:
|
|
178
|
-
case FunctionalComponent:
|
|
179
|
-
case ClassComponent:
|
|
180
|
-
case HostComponent:
|
|
181
|
-
var owner = fiber._debugOwner;
|
|
182
|
-
var source = fiber._debugSource;
|
|
183
|
-
var name = getComponentName(fiber);
|
|
184
|
-
var ownerName = null;
|
|
185
|
-
if (owner) {
|
|
186
|
-
ownerName = getComponentName(owner);
|
|
187
|
-
}
|
|
188
|
-
return describeComponentFrame(name, source, ownerName);
|
|
189
|
-
default:
|
|
190
|
-
return '';
|
|
191
|
-
}
|
|
167
|
+
return describeComponentFrame(name || '', element && element._source, ownerName || '');
|
|
192
168
|
}
|
|
193
169
|
|
|
194
170
|
var ReactComponentTreeHook = {
|
|
@@ -296,7 +272,7 @@ var ReactComponentTreeHook = {
|
|
|
296
272
|
var workInProgress = currentOwner;
|
|
297
273
|
// Safe because if current owner exists, we are reconciling,
|
|
298
274
|
// and it is guaranteed to be the work-in-progress version.
|
|
299
|
-
info +=
|
|
275
|
+
info += getStackAddendumByWorkInProgressFiber(workInProgress);
|
|
300
276
|
} else if (typeof currentOwner._debugID === 'number') {
|
|
301
277
|
info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
|
|
302
278
|
}
|
|
@@ -311,21 +287,6 @@ var ReactComponentTreeHook = {
|
|
|
311
287
|
}
|
|
312
288
|
return info;
|
|
313
289
|
},
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
// This function can only be called with a work-in-progress fiber and
|
|
317
|
-
// only during begin or complete phase. Do not call it under any other
|
|
318
|
-
// circumstances.
|
|
319
|
-
getStackAddendumByWorkInProgressFiber: function (workInProgress) {
|
|
320
|
-
var info = '';
|
|
321
|
-
var node = workInProgress;
|
|
322
|
-
do {
|
|
323
|
-
info += describeFiber(node);
|
|
324
|
-
// Otherwise this return pointer might point to the wrong tree:
|
|
325
|
-
node = node['return'];
|
|
326
|
-
} while (node);
|
|
327
|
-
return info;
|
|
328
|
-
},
|
|
329
290
|
getChildIDs: function (id) {
|
|
330
291
|
var item = getItem(id);
|
|
331
292
|
return item ? item.childIDs : [];
|
package/lib/ReactCurrentOwner.js
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var ReactDebugCurrentFrame = {};
|
|
15
|
+
|
|
16
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
17
|
+
var _require = require('./ReactComponentTreeHook'),
|
|
18
|
+
getStackAddendumByID = _require.getStackAddendumByID,
|
|
19
|
+
getCurrentStackAddendum = _require.getCurrentStackAddendum;
|
|
20
|
+
|
|
21
|
+
var _require2 = require('./ReactFiberComponentTreeHook'),
|
|
22
|
+
getStackAddendumByWorkInProgressFiber = _require2.getStackAddendumByWorkInProgressFiber;
|
|
23
|
+
|
|
24
|
+
// Component that is being worked on
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
ReactDebugCurrentFrame.current = null;
|
|
28
|
+
|
|
29
|
+
// Element that is being cloned or created
|
|
30
|
+
ReactDebugCurrentFrame.element = null;
|
|
31
|
+
|
|
32
|
+
ReactDebugCurrentFrame.getStackAddendum = function () {
|
|
33
|
+
var stack = null;
|
|
34
|
+
var current = ReactDebugCurrentFrame.current;
|
|
35
|
+
var element = ReactDebugCurrentFrame.element;
|
|
36
|
+
if (current !== null) {
|
|
37
|
+
if (typeof current === 'number') {
|
|
38
|
+
// DebugID from Stack.
|
|
39
|
+
var debugID = current;
|
|
40
|
+
stack = getStackAddendumByID(debugID);
|
|
41
|
+
} else if (typeof current.tag === 'number') {
|
|
42
|
+
// This is a Fiber.
|
|
43
|
+
// The stack will only be correct if this is a work in progress
|
|
44
|
+
// version and we're calling it during reconciliation.
|
|
45
|
+
var workInProgress = current;
|
|
46
|
+
stack = getStackAddendumByWorkInProgressFiber(workInProgress);
|
|
47
|
+
}
|
|
48
|
+
} else if (element !== null) {
|
|
49
|
+
stack = getCurrentStackAddendum(element);
|
|
50
|
+
}
|
|
51
|
+
return stack;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
module.exports = ReactDebugCurrentFrame;
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
20
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
21
|
-
var ReactComponentTreeHook = require('./ReactComponentTreeHook');
|
|
22
21
|
var ReactElement = require('./ReactElement');
|
|
23
22
|
|
|
24
23
|
var checkReactTypeSpec = require('./checkReactTypeSpec');
|
|
@@ -26,13 +25,20 @@ var checkReactTypeSpec = require('./checkReactTypeSpec');
|
|
|
26
25
|
var canDefineProperty = require('./canDefineProperty');
|
|
27
26
|
var getComponentName = require('./getComponentName');
|
|
28
27
|
var getIteratorFn = require('./getIteratorFn');
|
|
29
|
-
|
|
28
|
+
|
|
29
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
30
|
+
var warning = require('fbjs/lib/warning');
|
|
31
|
+
var ReactDebugCurrentFrame = require('./ReactDebugCurrentFrame');
|
|
32
|
+
|
|
33
|
+
var _require = require('./ReactComponentTreeHook'),
|
|
34
|
+
getCurrentStackAddendum = _require.getCurrentStackAddendum;
|
|
35
|
+
}
|
|
30
36
|
|
|
31
37
|
function getDeclarationErrorAddendum() {
|
|
32
38
|
if (ReactCurrentOwner.current) {
|
|
33
39
|
var name = getComponentName(ReactCurrentOwner.current);
|
|
34
40
|
if (name) {
|
|
35
|
-
return '
|
|
41
|
+
return '\n\nCheck the render method of `' + name + '`.';
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
44
|
return '';
|
|
@@ -43,7 +49,7 @@ function getSourceInfoErrorAddendum(elementProps) {
|
|
|
43
49
|
var source = elementProps.__source;
|
|
44
50
|
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
45
51
|
var lineNumber = source.lineNumber;
|
|
46
|
-
return '
|
|
52
|
+
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
47
53
|
}
|
|
48
54
|
return '';
|
|
49
55
|
}
|
|
@@ -61,7 +67,7 @@ function getCurrentComponentErrorInfo(parentType) {
|
|
|
61
67
|
if (!info) {
|
|
62
68
|
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
63
69
|
if (parentName) {
|
|
64
|
-
info = '
|
|
70
|
+
info = '\n\nCheck the top-level render call using <' + parentName + '>.';
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
return info;
|
|
@@ -101,7 +107,7 @@ function validateExplicitKey(element, parentType) {
|
|
|
101
107
|
childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
|
|
102
108
|
}
|
|
103
109
|
|
|
104
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner,
|
|
110
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getCurrentStackAddendum(element)) : void 0;
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
/**
|
|
@@ -159,7 +165,7 @@ function validatePropTypes(element) {
|
|
|
159
165
|
}
|
|
160
166
|
var name = componentClass.displayName || componentClass.name;
|
|
161
167
|
if (componentClass.propTypes) {
|
|
162
|
-
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name
|
|
168
|
+
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name);
|
|
163
169
|
}
|
|
164
170
|
if (typeof componentClass.getDefaultProps === 'function') {
|
|
165
171
|
process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
|
@@ -167,29 +173,26 @@ function validatePropTypes(element) {
|
|
|
167
173
|
}
|
|
168
174
|
|
|
169
175
|
var ReactElementValidator = {
|
|
170
|
-
|
|
171
176
|
createElement: function (type, props, children) {
|
|
172
|
-
var validType = typeof type === 'string' || typeof type === 'function'
|
|
177
|
+
var validType = typeof type === 'string' || typeof type === 'function';
|
|
173
178
|
// We warn in this case but don't throw. We expect the element creation to
|
|
174
179
|
// succeed and there will likely be errors in render.
|
|
175
180
|
if (!validType) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
+
var info = '';
|
|
182
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
183
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in.";
|
|
184
|
+
}
|
|
181
185
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
var sourceInfo = getSourceInfoErrorAddendum(props);
|
|
187
|
+
if (sourceInfo) {
|
|
188
|
+
info += sourceInfo;
|
|
189
|
+
} else {
|
|
190
|
+
info += getDeclarationErrorAddendum();
|
|
191
|
+
}
|
|
188
192
|
|
|
189
|
-
|
|
193
|
+
info += getCurrentStackAddendum();
|
|
190
194
|
|
|
191
|
-
|
|
192
|
-
}
|
|
195
|
+
process.env.NODE_ENV !== '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;
|
|
193
196
|
}
|
|
194
197
|
|
|
195
198
|
var element = ReactElement.createElement.apply(this, arguments);
|
|
@@ -200,6 +203,10 @@ var ReactElementValidator = {
|
|
|
200
203
|
return element;
|
|
201
204
|
}
|
|
202
205
|
|
|
206
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
207
|
+
ReactDebugCurrentFrame.element = element;
|
|
208
|
+
}
|
|
209
|
+
|
|
203
210
|
// Skip key warning if the type isn't valid since our key validation logic
|
|
204
211
|
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
205
212
|
// We don't want exception behavior to differ between dev and prod.
|
|
@@ -213,6 +220,10 @@ var ReactElementValidator = {
|
|
|
213
220
|
|
|
214
221
|
validatePropTypes(element);
|
|
215
222
|
|
|
223
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
224
|
+
ReactDebugCurrentFrame.element = null;
|
|
225
|
+
}
|
|
226
|
+
|
|
216
227
|
return element;
|
|
217
228
|
},
|
|
218
229
|
|
|
@@ -241,13 +252,18 @@ var ReactElementValidator = {
|
|
|
241
252
|
|
|
242
253
|
cloneElement: function (element, props, children) {
|
|
243
254
|
var newElement = ReactElement.cloneElement.apply(this, arguments);
|
|
255
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
256
|
+
ReactDebugCurrentFrame.element = newElement;
|
|
257
|
+
}
|
|
244
258
|
for (var i = 2; i < arguments.length; i++) {
|
|
245
259
|
validateChildKeys(arguments[i], newElement.type);
|
|
246
260
|
}
|
|
247
261
|
validatePropTypes(newElement);
|
|
262
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
263
|
+
ReactDebugCurrentFrame.element = null;
|
|
264
|
+
}
|
|
248
265
|
return newElement;
|
|
249
266
|
}
|
|
250
|
-
|
|
251
267
|
};
|
|
252
268
|
|
|
253
269
|
module.exports = ReactElementValidator;
|