Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

Commit

Permalink
React.PropTypes => PropTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
isnifer committed Aug 9, 2017
1 parent ede35cd commit ed26c43
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 38 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"invariant": "^2.2.1",
"lodash": "^4.6.1",
"mirror-creator": "^1.1.0",
"prop-types": "^15.5.10",
"react-addons-pure-render-mixin": "^15.5.2",
"react-addons-shallow-compare": "15.5.2",
"react-clone-referenced-element": "^1.0.1",
Expand Down
3 changes: 2 additions & 1 deletion src/ExNavigationBar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropTypes } from 'react';
import React from 'react';
import {
Animated,
Image,
Expand All @@ -9,6 +9,7 @@ import {
View,
ViewPropTypes,
} from 'react-native';
import PropTypes from 'prop-types';
import PureComponent from './utils/PureComponent';
import { unsupportedNativeView } from './ExUnsupportedNativeView';
import { withNavigation } from './ExNavigationComponents';
Expand Down
9 changes: 5 additions & 4 deletions src/ExNavigationComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* @flow
*/

import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';

import UUID from 'uuid-js';

Expand Down Expand Up @@ -231,7 +232,7 @@ export const createFocusableComponent = (WrappedComponent: ReactClass<any>) => {
_wrappedInstance: ReactElement<T>;

static childContextTypes = {
isFocused: React.PropTypes.bool,
isFocused: PropTypes.bool,
};

getChildContext() {
Expand Down Expand Up @@ -329,11 +330,11 @@ export const createFocusAwareComponent = <T>(
) => {
class FocusAwareComponent extends React.Component {
static contextTypes = {
isFocused: React.PropTypes.bool,
isFocused: PropTypes.bool,
};

static childContextTypes = {
isFocused: React.PropTypes.bool,
isFocused: PropTypes.bool,
};

_wrappedInstance: ReactElement<T>;
Expand Down
2 changes: 1 addition & 1 deletion src/ExNavigationPropTypes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropTypes } from 'react';
import PropTypes from 'prop-types';

export const NavigationPropType = PropTypes.shape({
getNavigator: PropTypes.func.isRequired,
Expand Down
3 changes: 2 additions & 1 deletion src/ExNavigationProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* @flow
*/

import React, { PropTypes } from 'react';
import React from 'react';
import { View, StyleSheet } from 'react-native';
import PropTypes from 'prop-types';

import storeShape from 'react-redux/lib/utils/storeShape';

Expand Down
15 changes: 8 additions & 7 deletions src/ExNavigationStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import React from 'react';
import { Animated, Platform, StyleSheet, View } from 'react-native';
import PropTypes from 'prop-types';
import NavigationExperimental from './navigation-experimental';

import _ from 'lodash';
Expand Down Expand Up @@ -273,16 +274,16 @@ class ExNavigationStack extends PureComponent<any, Props, State> {
};

static contextTypes = {
parentNavigatorUID: React.PropTypes.string,
headerComponent: React.PropTypes.func,
alertBarComponent: React.PropTypes.func,
parentNavigatorUID: PropTypes.string,
headerComponent: PropTypes.func,
alertBarComponent: PropTypes.func,
};

static childContextTypes = {
parentNavigatorUID: React.PropTypes.string,
navigator: React.PropTypes.instanceOf(ExNavigationStackContext),
headerComponent: React.PropTypes.func,
alertBarComponent: React.PropTypes.func,
parentNavigatorUID: PropTypes.string,
navigator: PropTypes.instanceOf(ExNavigationStackContext),
headerComponent: PropTypes.func,
alertBarComponent: PropTypes.func,
};

getChildContext() {
Expand Down
3 changes: 2 additions & 1 deletion src/ExNavigationStackItem.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { PropTypes } from 'react';
import React from 'react';
import { Animated, StyleSheet } from 'react-native';
import PropTypes from 'prop-types';

import PureComponent from './utils/PureComponent';

Expand Down
2 changes: 1 addition & 1 deletion src/ExUnsupportedNativeView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PropTypes } from 'react';
import React from 'react';
import { View } from 'react-native';

export function unsupportedNativeView(name) {
Expand Down
7 changes: 4 additions & 3 deletions src/drawer/ExNavigationDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import React, { Children } from 'react';
import { StyleSheet, View } from 'react-native';
import PropTypes from 'prop-types';
import DrawerLayout from 'react-native-drawer-layout-polyfill';
import PureComponent from '../utils/PureComponent';
import StaticContainer from 'react-static-container';
Expand Down Expand Up @@ -97,12 +98,12 @@ class ExNavigationDrawer extends PureComponent<any, Props, State> {
};

static contextTypes = {
parentNavigatorUID: React.PropTypes.string,
parentNavigatorUID: PropTypes.string,
};

static childContextTypes = {
parentNavigatorUID: React.PropTypes.string,
navigator: React.PropTypes.instanceOf(ExNavigationDrawerContext),
parentNavigatorUID: PropTypes.string,
navigator: PropTypes.instanceOf(ExNavigationDrawerContext),
};

getChildContext() {
Expand Down
3 changes: 1 addition & 2 deletions src/navigation-experimental/NavigationCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const NavigationPagerStyleInterpolator = require('./NavigationPagerStyleInterpol
const NavigationPointerEventsContainer = require('./NavigationPointerEventsContainer');
const NavigationPropTypes = require('./NavigationPropTypes');
const React = require('react');
const PropTypes = require('prop-types');

import type {
NavigationPanPanHandlers,
Expand All @@ -55,8 +56,6 @@ type Props = NavigationSceneRendererProps & {
style: any,
};

const {PropTypes} = React;

/**
* Component that renders the scene as card for the <NavigationCardStack />.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/navigation-experimental/NavigationCardStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ const {
View,
ViewPropTypes,
} = require('react-native');
const PropTypes = require('prop-types');

const { NativeAnimatedModule } = NativeModules;
const { PropTypes } = React;
const { Directions } = NavigationCardStackPanResponder;

import type {
Expand Down
2 changes: 1 addition & 1 deletion src/navigation-experimental/NavigationHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const NavigationHeaderTitle = require('./NavigationHeaderTitle');
const NavigationPropTypes = require('./NavigationPropTypes');
const React = require('react');
const ReactNative = require('react-native');
const PropTypes = require('prop-types');
const ReactComponentWithPureRenderMixin = require('react-addons-pure-render-mixin');

const {
Expand Down Expand Up @@ -80,7 +81,6 @@ type SubViewName = 'left' | 'title' | 'right';

const APPBAR_HEIGHT = Platform.OS === 'ios' ? 44 : 56;
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : 0;
const { PropTypes } = React;

class NavigationHeader extends React.Component<DefaultProps, Props, any> {
props: Props;
Expand Down
3 changes: 2 additions & 1 deletion src/navigation-experimental/NavigationHeaderBackButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

const React = require('react');
const ReactNative = require('react-native');
const PropTypes = require('prop-types');

const {
I18nManager,
Expand All @@ -46,7 +47,7 @@ const NavigationHeaderBackButton = (props: Props) => (
);

NavigationHeaderBackButton.propTypes = {
onPress: React.PropTypes.func.isRequired
onPress: PropTypes.func.isRequired
};

const styles = StyleSheet.create({
Expand Down
3 changes: 2 additions & 1 deletion src/navigation-experimental/NavigationHeaderTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

const React = require('react');
const ReactNative = require('react-native');
const PropTypes = require('prop-types');

const { Platform, StyleSheet, View, Text, ViewPropTypes } = ReactNative;

Expand Down Expand Up @@ -72,7 +73,7 @@ const styles = StyleSheet.create({
});

NavigationHeaderTitle.propTypes = {
children: React.PropTypes.node.isRequired,
children: PropTypes.node.isRequired,
style: ViewPropTypes.style,
textStyle: Text.propTypes.style,
};
Expand Down
5 changes: 2 additions & 3 deletions src/navigation-experimental/NavigationPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ import type {

const {Animated} = require('react-native');
const React = require('react');

const {PropTypes} = React;
const PropTypes = require('prop-types');

/* NavigationAction */
const action = PropTypes.shape({
const action = PropTypes.shape({
type: PropTypes.string.isRequired,
});

Expand Down
3 changes: 1 addition & 2 deletions src/navigation-experimental/NavigationTransitioner.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const {Animated, Easing, StyleSheet, View} = require('react-native');
const NavigationPropTypes = require('./NavigationPropTypes');
const NavigationScenesReducer = require('./NavigationScenesReducer');
const React = require('react');
const PropTypes = require('prop-types');

const invariant = require('fbjs/lib/invariant');

Expand Down Expand Up @@ -45,8 +46,6 @@ type State = {
scenes: Array<NavigationScene>,
};

const {PropTypes} = React;

const DefaultTransitionSpec = {
duration: 250,
easing: Easing.inOut(Easing.ease),
Expand Down
3 changes: 2 additions & 1 deletion src/shared-element/ExNavigationSharedElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* @flow
*/

import React, { Component, PropTypes, cloneElement } from 'react';
import React, { Component, cloneElement } from 'react';
import { UIManager, findNodeHandle } from 'react-native';
import PropTypes from 'prop-types';
import invariant from 'invariant';

import type {
Expand Down
3 changes: 2 additions & 1 deletion src/shared-element/ExNavigationSharedElementGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*/

import _ from 'lodash';
import React, { cloneElement, Children, Component, PropTypes } from 'react';
import React, { cloneElement, Children, Component } from 'react';
import { Animated, Easing, View } from 'react-native';
import PropTypes from 'prop-types';

import UUID from 'uuid-js';

Expand Down
7 changes: 4 additions & 3 deletions src/sliding-tab/ExNavigationSlidingTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import React, { Children } from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import PropTypes from 'prop-types';
import PureComponent from '../utils/PureComponent';
import StaticContainer from 'react-static-container';

Expand Down Expand Up @@ -92,12 +93,12 @@ class ExNavigationSlidingTab extends PureComponent<any, Props, State> {
};

static contextTypes = {
parentNavigatorUID: React.PropTypes.string,
parentNavigatorUID: PropTypes.string,
};

static childContextTypes = {
parentNavigatorUID: React.PropTypes.string,
navigator: React.PropTypes.instanceOf(ExNavigationTabContext),
parentNavigatorUID: PropTypes.string,
navigator: PropTypes.instanceOf(ExNavigationTabContext),
};

constructor(props, context) {
Expand Down
7 changes: 4 additions & 3 deletions src/tab/ExNavigationTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import React, { Children } from 'react';
import { StyleSheet, View } from 'react-native';
import PropTypes from 'prop-types';
import PureComponent from '../utils/PureComponent';
import StaticContainer from 'react-static-container';

Expand Down Expand Up @@ -98,12 +99,12 @@ class ExNavigationTab extends PureComponent<any, Props, State> {
};

static contextTypes = {
parentNavigatorUID: React.PropTypes.string,
parentNavigatorUID: PropTypes.string,
};

static childContextTypes = {
parentNavigatorUID: React.PropTypes.string,
navigator: React.PropTypes.instanceOf(ExNavigationTabContext),
parentNavigatorUID: PropTypes.string,
navigator: PropTypes.instanceOf(ExNavigationTabContext),
};

getChildContext() {
Expand Down

0 comments on commit ed26c43

Please sign in to comment.