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:
Brian Vaughn 2017-04-14 15:42:47 -07:00 committed by Facebook Github Bot
parent b9b03435c4
commit f3e56cbbb7
3 changed files with 22 additions and 18 deletions

View File

@ -16,6 +16,7 @@ const ColorPropType = require('ColorPropType');
const EdgeInsetsPropType = require('EdgeInsetsPropType');
const Platform = require('Platform');
const PointPropType = require('PointPropType');
const PropTypes = require('prop-types');
const React = require('React');
const ReactNative = require('ReactNative');
const ScrollResponder = require('ScrollResponder');
@ -30,7 +31,6 @@ const dismissKeyboard = require('dismissKeyboard');
const flattenStyle = require('flattenStyle');
const invariant = require('fbjs/lib/invariant');
const processDecelerationRate = require('processDecelerationRate');
const PropTypes = React.PropTypes;
const requireNativeComponent = require('requireNativeComponent');
/**

View File

@ -11,6 +11,7 @@
'use strict';
var PropTypes;
var React;
var ReactNoop;
var ReactFeatureFlags;
@ -18,6 +19,7 @@ var ReactFeatureFlags;
describe('ReactIncremental', () => {
beforeEach(() => {
jest.resetModules();
PropTypes = require('prop-types');
React = require('react');
ReactNoop = require('ReactNoop');
@ -1594,7 +1596,7 @@ describe('ReactIncremental', () => {
class Intl extends React.Component {
static childContextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
getChildContext() {
return {
@ -1609,7 +1611,7 @@ describe('ReactIncremental', () => {
class Router extends React.Component {
static childContextTypes = {
route: React.PropTypes.string,
route: PropTypes.string,
};
getChildContext() {
return {
@ -1624,7 +1626,7 @@ describe('ReactIncremental', () => {
class ShowLocale extends React.Component {
static contextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
render() {
ops.push('ShowLocale ' + JSON.stringify(this.context));
@ -1634,7 +1636,7 @@ describe('ReactIncremental', () => {
class ShowRoute extends React.Component {
static contextTypes = {
route: React.PropTypes.string,
route: PropTypes.string,
};
render() {
ops.push('ShowRoute ' + JSON.stringify(this.context));
@ -1647,8 +1649,8 @@ describe('ReactIncremental', () => {
return `${context.route} in ${context.locale}`;
}
ShowBoth.contextTypes = {
locale: React.PropTypes.string,
route: React.PropTypes.string,
locale: PropTypes.string,
route: PropTypes.string,
};
class ShowNeither extends React.Component {
@ -1747,10 +1749,10 @@ describe('ReactIncremental', () => {
var ops = [];
class Recurse extends React.Component {
static contextTypes = {
n: React.PropTypes.number,
n: PropTypes.number,
};
static childContextTypes = {
n: React.PropTypes.number,
n: PropTypes.number,
};
getChildContext() {
return {n: (this.context.n || 3) - 1};
@ -1779,7 +1781,7 @@ describe('ReactIncremental', () => {
class Intl extends React.Component {
static childContextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
getChildContext() {
return {
@ -1794,7 +1796,7 @@ describe('ReactIncremental', () => {
class ShowLocale extends React.Component {
static contextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
render() {
ops.push('ShowLocale ' + JSON.stringify(this.context));
@ -1837,7 +1839,7 @@ describe('ReactIncremental', () => {
class Intl extends React.Component {
static childContextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
getChildContext() {
const childContext = {
@ -1854,7 +1856,7 @@ describe('ReactIncremental', () => {
class ShowLocaleClass extends React.Component {
static contextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
render() {
ops.push('ShowLocaleClass:read ' + JSON.stringify(this.context));
@ -1867,7 +1869,7 @@ describe('ReactIncremental', () => {
return context.locale;
}
ShowLocaleFn.contextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
class Stateful extends React.Component {
@ -1927,7 +1929,7 @@ describe('ReactIncremental', () => {
class Intl extends React.Component {
static childContextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
getChildContext() {
const childContext = {
@ -1944,7 +1946,7 @@ describe('ReactIncremental', () => {
class ShowLocaleClass extends React.Component {
static contextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
render() {
ops.push('ShowLocaleClass:read ' + JSON.stringify(this.context));
@ -1957,7 +1959,7 @@ describe('ReactIncremental', () => {
return context.locale;
}
ShowLocaleFn.contextTypes = {
locale: React.PropTypes.string,
locale: PropTypes.string,
};
function IndirectionFn(props, context) {

View File

@ -12,6 +12,7 @@
'use strict';
describe('ReactDebugFiberPerf', () => {
let PropTypes;
let React;
let ReactCoroutine;
let ReactFeatureFlags;
@ -113,6 +114,7 @@ describe('ReactDebugFiberPerf', () => {
global.performance = createUserTimingPolyfill();
// Import after the polyfill is set up:
PropTypes = require('prop-types');
React = require('React');
ReactCoroutine = require('ReactCoroutine');
ReactFeatureFlags = require('ReactFeatureFlags');
@ -245,7 +247,7 @@ describe('ReactDebugFiberPerf', () => {
it('captures all lifecycles', () => {
class AllLifecycles extends React.Component {
static childContextTypes = {
foo: React.PropTypes.any,
foo: PropTypes.any,
};
shouldComponentUpdate() {
return true;