diff --git a/.eslintignore b/.eslintignore
index cdcaed49e2..ebf7c8163c 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,5 +1,5 @@
# We can probably lint these later but not important at this point
-addons/
+addons/**/node_modules/
src/renderers/art
src/shared/vendor
# But not in docs/_js/examples/*
diff --git a/addons/create-react-class/factory.js b/addons/create-react-class/factory.js
index 61741cce4b..33f0b244f1 100644
--- a/addons/create-react-class/factory.js
+++ b/addons/create-react-class/factory.js
@@ -43,7 +43,6 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
* Policies that describe methods in `ReactClassInterface`.
*/
-
var injectedMixins = [];
/**
@@ -69,7 +68,6 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
* @internal
*/
var ReactClassInterface = {
-
/**
* An array of Mixin objects to include when defining your component.
*
@@ -286,8 +284,7 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
* @internal
* @overridable
*/
- updateComponent: 'OVERRIDE_BASE'
-
+ updateComponent: 'OVERRIDE_BASE',
};
/**
@@ -300,71 +297,106 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
* which all other static methods are defined.
*/
var RESERVED_SPEC_KEYS = {
- displayName: function (Constructor, displayName) {
+ displayName: function(Constructor, displayName) {
Constructor.displayName = displayName;
},
- mixins: function (Constructor, mixins) {
+ mixins: function(Constructor, mixins) {
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
mixSpecIntoComponent(Constructor, mixins[i]);
}
}
},
- childContextTypes: function (Constructor, childContextTypes) {
+ childContextTypes: function(Constructor, childContextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, childContextTypes, 'childContext');
}
- Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
+ Constructor.childContextTypes = _assign(
+ {},
+ Constructor.childContextTypes,
+ childContextTypes,
+ );
},
- contextTypes: function (Constructor, contextTypes) {
+ contextTypes: function(Constructor, contextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, contextTypes, 'context');
}
- Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
+ Constructor.contextTypes = _assign(
+ {},
+ Constructor.contextTypes,
+ contextTypes,
+ );
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
- getDefaultProps: function (Constructor, getDefaultProps) {
+ getDefaultProps: function(Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
- Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
+ Constructor.getDefaultProps = createMergedResultFunction(
+ Constructor.getDefaultProps,
+ getDefaultProps,
+ );
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
- propTypes: function (Constructor, propTypes) {
+ propTypes: function(Constructor, propTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, propTypes, 'prop');
}
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
},
- statics: function (Constructor, statics) {
+ statics: function(Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
- autobind: function () {} };
+ 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__
- 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', ReactPropTypeLocationNames[location], propName) : void 0;
+ if (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',
+ ReactPropTypeLocationNames[location],
+ propName,
+ );
+ }
}
}
}
function validateMethodOverride(isAlreadyDefined, name) {
- var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
+ 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);
+ _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);
+ _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,
+ );
}
}
@@ -378,14 +410,33 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
var typeofSpec = typeof spec;
var isMixinValid = typeofSpec === 'object' && spec !== null;
- 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;
+ if (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,
+ );
+ }
}
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.');
+ _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;
@@ -420,7 +471,11 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
// 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;
+ var shouldAutoBind =
+ isFunction &&
+ !isReactClassMethod &&
+ !isAlreadyDefined &&
+ spec.autobind !== false;
if (shouldAutoBind) {
autoBindPairs.push(name, property);
@@ -430,7 +485,15 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
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);
+ _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.
@@ -465,10 +528,23 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
}
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);
+ _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);
+ _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;
}
}
@@ -481,11 +557,22 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
* @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.');
+ _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);
+ _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];
}
}
@@ -546,8 +633,14 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
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++) {
+ 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];
}
@@ -555,9 +648,24 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component && newThis !== null) {
- process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
+ if (process.env.NODE_ENV !== 'production') {
+ warning(
+ false,
+ 'bind(): React component methods may only be bound to the ' +
+ 'component instance. See %s',
+ componentName,
+ );
+ }
} else if (!args.length) {
- 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. See %s', componentName) : void 0;
+ if (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. See %s',
+ componentName,
+ );
+ }
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
@@ -585,15 +693,15 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
}
var IsMountedPreMixin = {
- componentDidMount: function () {
+ componentDidMount: function() {
this.__isMounted = true;
- }
+ },
};
var IsMountedPostMixin = {
- componentWillUnmount: function () {
+ componentWillUnmount: function() {
this.__isMounted = false;
- }
+ },
};
/**
@@ -601,12 +709,11 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
* 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) {
+ replaceState: function(newState, callback) {
this.updater.enqueueReplaceState(this, newState, callback);
},
@@ -616,17 +723,29 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
* @protected
* @final
*/
- isMounted: function () {
+ isMounted: function() {
if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== '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') : void 0;
+ 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);
+ var ReactClassComponent = function() {};
+ _assign(
+ ReactClassComponent.prototype,
+ ReactComponent.prototype,
+ ReactClassMixin,
+ );
/**
* Creates a composite component class given a class specification.
@@ -640,12 +759,16 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
// 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) {
+ 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 (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== '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;
+ 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
@@ -666,13 +789,20 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
var initialState = this.getInitialState ? this.getInitialState() : null;
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
- if (initialState === undefined && this.getInitialState._isMockFunction) {
+ 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');
+ _invariant(
+ typeof initialState === 'object' && !Array.isArray(initialState),
+ '%s.getInitialState(): must return an object or null',
+ Constructor.displayName || 'ReactCompositeComponent',
+ );
this.state = initialState;
});
@@ -704,11 +834,26 @@ function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
}
}
- _invariant(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.');
+ _invariant(
+ Constructor.prototype.render,
+ 'createClass(...): Class specification must implement a `render` method.',
+ );
if (process.env.NODE_ENV !== 'production') {
- process.env.NODE_ENV !== '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;
- process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
+ 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.
diff --git a/addons/create-react-class/index.js b/addons/create-react-class/index.js
index 8295b22ad9..24af289603 100644
--- a/addons/create-react-class/index.js
+++ b/addons/create-react-class/index.js
@@ -19,5 +19,5 @@ var ReactNoopUpdateQueue = new React.Component().updater;
module.exports = factory(
React.Component,
React.isValidElement,
- ReactNoopUpdateQueue
+ ReactNoopUpdateQueue,
);
diff --git a/addons/create-react-class/test.js b/addons/create-react-class/test.js
index a2daebe762..86a1ab0001 100644
--- a/addons/create-react-class/test.js
+++ b/addons/create-react-class/test.js
@@ -23,7 +23,11 @@ global.requestAnimationFrame = function(callback) {
global.requestIdleCallback = function(callback) {
setTimeout(() => {
- callback({ timeRemaining() { return Infinity; } });
+ callback({
+ timeRemaining() {
+ return Infinity;
+ },
+ });
});
};
@@ -39,7 +43,7 @@ describe('ReactClass-spec', () => {
expect(function() {
createReactClass({});
}).toThrowError(
- 'createClass(...): Class specification must implement a `render` method.'
+ 'createClass(...): Class specification must implement a `render` method.',
);
});
@@ -51,8 +55,7 @@ describe('ReactClass-spec', () => {
},
});
- expect(TestComponent.displayName)
- .toBe('TestComponent');
+ expect(TestComponent.displayName).toBe('TestComponent');
});
it('should copy prop types onto the Constructor', () => {
@@ -67,8 +70,7 @@ describe('ReactClass-spec', () => {
});
expect(TestComponent.propTypes).toBeDefined();
- expect(TestComponent.propTypes.value)
- .toBe(propValidator);
+ expect(TestComponent.propTypes.value).toBe(propValidator);
});
it('should warn on invalid prop types', () => {
@@ -85,7 +87,7 @@ describe('ReactClass-spec', () => {
expect(console.error.calls.count()).toBe(1);
expect(console.error.calls.argsFor(0)[0]).toBe(
'Warning: Component: prop type `prop` is invalid; ' +
- 'it must be a function, usually from React.PropTypes.'
+ 'it must be a function, usually from React.PropTypes.',
);
});
@@ -103,7 +105,7 @@ describe('ReactClass-spec', () => {
expect(console.error.calls.count()).toBe(1);
expect(console.error.calls.argsFor(0)[0]).toBe(
'Warning: Component: context type `prop` is invalid; ' +
- 'it must be a function, usually from React.PropTypes.'
+ 'it must be a function, usually from React.PropTypes.',
);
});
@@ -121,7 +123,7 @@ describe('ReactClass-spec', () => {
expect(console.error.calls.count()).toBe(1);
expect(console.error.calls.argsFor(0)[0]).toBe(
'Warning: Component: child context type `prop` is invalid; ' +
- 'it must be a function, usually from React.PropTypes.'
+ 'it must be a function, usually from React.PropTypes.',
);
});
@@ -139,8 +141,8 @@ describe('ReactClass-spec', () => {
expect(console.error.calls.count()).toBe(1);
expect(console.error.calls.argsFor(0)[0]).toBe(
'Warning: A component 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.'
+ 'mean shouldComponentUpdate()? The name is phrased as a question ' +
+ 'because the function is expected to return a value.',
);
createReactClass({
@@ -155,8 +157,8 @@ describe('ReactClass-spec', () => {
expect(console.error.calls.count()).toBe(2);
expect(console.error.calls.argsFor(1)[0]).toBe(
'Warning: NamedComponent 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.'
+ 'mean shouldComponentUpdate()? The name is phrased as a question ' +
+ 'because the function is expected to return a value.',
);
});
@@ -173,7 +175,7 @@ describe('ReactClass-spec', () => {
expect(console.error.calls.count()).toBe(1);
expect(console.error.calls.argsFor(0)[0]).toBe(
'Warning: A component has a method called componentWillRecieveProps(). Did you ' +
- 'mean componentWillReceiveProps()?'
+ 'mean componentWillReceiveProps()?',
);
});
@@ -194,9 +196,9 @@ describe('ReactClass-spec', () => {
});
}).toThrowError(
'ReactClass: You are attempting to define a reserved property, ' +
- '`getDefaultProps`, that shouldn\'t be on the "statics" key. Define ' +
- 'it as an instance property instead; it will still be accessible on ' +
- 'the constructor.'
+ '`getDefaultProps`, that shouldn\'t be on the "statics" key. Define ' +
+ 'it as an instance property instead; it will still be accessible on ' +
+ 'the constructor.',
);
});
@@ -221,19 +223,19 @@ describe('ReactClass-spec', () => {
expect(console.error.calls.count()).toBe(4);
expect(console.error.calls.argsFor(0)[0]).toBe(
'createClass(...): `mixins` is now a static property and should ' +
- 'be defined inside "statics".'
+ 'be defined inside "statics".',
);
expect(console.error.calls.argsFor(1)[0]).toBe(
'createClass(...): `propTypes` is now a static property and should ' +
- 'be defined inside "statics".'
+ 'be defined inside "statics".',
);
expect(console.error.calls.argsFor(2)[0]).toBe(
'createClass(...): `contextTypes` is now a static property and ' +
- 'should be defined inside "statics".'
+ 'should be defined inside "statics".',
);
expect(console.error.calls.argsFor(3)[0]).toBe(
'createClass(...): `childContextTypes` is now a static property and ' +
- 'should be defined inside "statics".'
+ 'should be defined inside "statics".',
);
});
@@ -329,7 +331,7 @@ describe('ReactClass-spec', () => {
expect(function() {
instance = ReactTestUtils.renderIntoDocument(instance);
}).toThrowError(
- 'Component.getInitialState(): must return an object or null'
+ 'Component.getInitialState(): must return an object or null',
);
});
});
@@ -343,8 +345,8 @@ describe('ReactClass-spec', () => {
return ;
},
});
- expect(
- () => ReactTestUtils.renderIntoDocument(