Ran React.PropTypes codemod on fbsource again in case anything was missed
Reviewed By: flarnie Differential Revision: D4890226 fbshipit-source-id: 36b87bd4395c8cfbe260d2c73f919e62b11439a7
This commit is contained in:
parent
b9b03435c4
commit
f3e56cbbb7
|
@ -16,6 +16,7 @@ const ColorPropType = require('ColorPropType');
|
||||||
const EdgeInsetsPropType = require('EdgeInsetsPropType');
|
const EdgeInsetsPropType = require('EdgeInsetsPropType');
|
||||||
const Platform = require('Platform');
|
const Platform = require('Platform');
|
||||||
const PointPropType = require('PointPropType');
|
const PointPropType = require('PointPropType');
|
||||||
|
const PropTypes = require('prop-types');
|
||||||
const React = require('React');
|
const React = require('React');
|
||||||
const ReactNative = require('ReactNative');
|
const ReactNative = require('ReactNative');
|
||||||
const ScrollResponder = require('ScrollResponder');
|
const ScrollResponder = require('ScrollResponder');
|
||||||
|
@ -30,7 +31,6 @@ const dismissKeyboard = require('dismissKeyboard');
|
||||||
const flattenStyle = require('flattenStyle');
|
const flattenStyle = require('flattenStyle');
|
||||||
const invariant = require('fbjs/lib/invariant');
|
const invariant = require('fbjs/lib/invariant');
|
||||||
const processDecelerationRate = require('processDecelerationRate');
|
const processDecelerationRate = require('processDecelerationRate');
|
||||||
const PropTypes = React.PropTypes;
|
|
||||||
const requireNativeComponent = require('requireNativeComponent');
|
const requireNativeComponent = require('requireNativeComponent');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var PropTypes;
|
||||||
var React;
|
var React;
|
||||||
var ReactNoop;
|
var ReactNoop;
|
||||||
var ReactFeatureFlags;
|
var ReactFeatureFlags;
|
||||||
|
@ -18,6 +19,7 @@ var ReactFeatureFlags;
|
||||||
describe('ReactIncremental', () => {
|
describe('ReactIncremental', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.resetModules();
|
jest.resetModules();
|
||||||
|
PropTypes = require('prop-types');
|
||||||
React = require('react');
|
React = require('react');
|
||||||
ReactNoop = require('ReactNoop');
|
ReactNoop = require('ReactNoop');
|
||||||
|
|
||||||
|
@ -1594,7 +1596,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class Intl extends React.Component {
|
class Intl extends React.Component {
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
getChildContext() {
|
getChildContext() {
|
||||||
return {
|
return {
|
||||||
|
@ -1609,7 +1611,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class Router extends React.Component {
|
class Router extends React.Component {
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
route: React.PropTypes.string,
|
route: PropTypes.string,
|
||||||
};
|
};
|
||||||
getChildContext() {
|
getChildContext() {
|
||||||
return {
|
return {
|
||||||
|
@ -1624,7 +1626,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class ShowLocale extends React.Component {
|
class ShowLocale extends React.Component {
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
render() {
|
render() {
|
||||||
ops.push('ShowLocale ' + JSON.stringify(this.context));
|
ops.push('ShowLocale ' + JSON.stringify(this.context));
|
||||||
|
@ -1634,7 +1636,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class ShowRoute extends React.Component {
|
class ShowRoute extends React.Component {
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
route: React.PropTypes.string,
|
route: PropTypes.string,
|
||||||
};
|
};
|
||||||
render() {
|
render() {
|
||||||
ops.push('ShowRoute ' + JSON.stringify(this.context));
|
ops.push('ShowRoute ' + JSON.stringify(this.context));
|
||||||
|
@ -1647,8 +1649,8 @@ describe('ReactIncremental', () => {
|
||||||
return `${context.route} in ${context.locale}`;
|
return `${context.route} in ${context.locale}`;
|
||||||
}
|
}
|
||||||
ShowBoth.contextTypes = {
|
ShowBoth.contextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
route: React.PropTypes.string,
|
route: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
class ShowNeither extends React.Component {
|
class ShowNeither extends React.Component {
|
||||||
|
@ -1747,10 +1749,10 @@ describe('ReactIncremental', () => {
|
||||||
var ops = [];
|
var ops = [];
|
||||||
class Recurse extends React.Component {
|
class Recurse extends React.Component {
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
n: React.PropTypes.number,
|
n: PropTypes.number,
|
||||||
};
|
};
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
n: React.PropTypes.number,
|
n: PropTypes.number,
|
||||||
};
|
};
|
||||||
getChildContext() {
|
getChildContext() {
|
||||||
return {n: (this.context.n || 3) - 1};
|
return {n: (this.context.n || 3) - 1};
|
||||||
|
@ -1779,7 +1781,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class Intl extends React.Component {
|
class Intl extends React.Component {
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
getChildContext() {
|
getChildContext() {
|
||||||
return {
|
return {
|
||||||
|
@ -1794,7 +1796,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class ShowLocale extends React.Component {
|
class ShowLocale extends React.Component {
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
render() {
|
render() {
|
||||||
ops.push('ShowLocale ' + JSON.stringify(this.context));
|
ops.push('ShowLocale ' + JSON.stringify(this.context));
|
||||||
|
@ -1837,7 +1839,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class Intl extends React.Component {
|
class Intl extends React.Component {
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
getChildContext() {
|
getChildContext() {
|
||||||
const childContext = {
|
const childContext = {
|
||||||
|
@ -1854,7 +1856,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class ShowLocaleClass extends React.Component {
|
class ShowLocaleClass extends React.Component {
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
render() {
|
render() {
|
||||||
ops.push('ShowLocaleClass:read ' + JSON.stringify(this.context));
|
ops.push('ShowLocaleClass:read ' + JSON.stringify(this.context));
|
||||||
|
@ -1867,7 +1869,7 @@ describe('ReactIncremental', () => {
|
||||||
return context.locale;
|
return context.locale;
|
||||||
}
|
}
|
||||||
ShowLocaleFn.contextTypes = {
|
ShowLocaleFn.contextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
class Stateful extends React.Component {
|
class Stateful extends React.Component {
|
||||||
|
@ -1927,7 +1929,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class Intl extends React.Component {
|
class Intl extends React.Component {
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
getChildContext() {
|
getChildContext() {
|
||||||
const childContext = {
|
const childContext = {
|
||||||
|
@ -1944,7 +1946,7 @@ describe('ReactIncremental', () => {
|
||||||
|
|
||||||
class ShowLocaleClass extends React.Component {
|
class ShowLocaleClass extends React.Component {
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
render() {
|
render() {
|
||||||
ops.push('ShowLocaleClass:read ' + JSON.stringify(this.context));
|
ops.push('ShowLocaleClass:read ' + JSON.stringify(this.context));
|
||||||
|
@ -1957,7 +1959,7 @@ describe('ReactIncremental', () => {
|
||||||
return context.locale;
|
return context.locale;
|
||||||
}
|
}
|
||||||
ShowLocaleFn.contextTypes = {
|
ShowLocaleFn.contextTypes = {
|
||||||
locale: React.PropTypes.string,
|
locale: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
function IndirectionFn(props, context) {
|
function IndirectionFn(props, context) {
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
describe('ReactDebugFiberPerf', () => {
|
describe('ReactDebugFiberPerf', () => {
|
||||||
|
let PropTypes;
|
||||||
let React;
|
let React;
|
||||||
let ReactCoroutine;
|
let ReactCoroutine;
|
||||||
let ReactFeatureFlags;
|
let ReactFeatureFlags;
|
||||||
|
@ -113,6 +114,7 @@ describe('ReactDebugFiberPerf', () => {
|
||||||
global.performance = createUserTimingPolyfill();
|
global.performance = createUserTimingPolyfill();
|
||||||
|
|
||||||
// Import after the polyfill is set up:
|
// Import after the polyfill is set up:
|
||||||
|
PropTypes = require('prop-types');
|
||||||
React = require('React');
|
React = require('React');
|
||||||
ReactCoroutine = require('ReactCoroutine');
|
ReactCoroutine = require('ReactCoroutine');
|
||||||
ReactFeatureFlags = require('ReactFeatureFlags');
|
ReactFeatureFlags = require('ReactFeatureFlags');
|
||||||
|
@ -245,7 +247,7 @@ describe('ReactDebugFiberPerf', () => {
|
||||||
it('captures all lifecycles', () => {
|
it('captures all lifecycles', () => {
|
||||||
class AllLifecycles extends React.Component {
|
class AllLifecycles extends React.Component {
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
foo: React.PropTypes.any,
|
foo: PropTypes.any,
|
||||||
};
|
};
|
||||||
shouldComponentUpdate() {
|
shouldComponentUpdate() {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue