From f0dce1512b039003270f66104058c1c891d5d955 Mon Sep 17 00:00:00 2001 From: Elliot Hesp Date: Mon, 5 Jun 2017 10:04:04 +0100 Subject: [PATCH] [tests] Use prop-types over React.PropTypes --- tests/src/components/Banner.js | 9 +++++---- tests/src/components/OverviewControlButton.js | 3 ++- tests/src/components/StatusIndicator.js | 3 ++- tests/src/components/TestControlButton.js | 3 ++- tests/src/components/TestSuiteControlButton.js | 3 ++- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/src/components/Banner.js b/tests/src/components/Banner.js index 18861ece..229f664f 100644 --- a/tests/src/components/Banner.js +++ b/tests/src/components/Banner.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { StyleSheet, View, Text } from 'react-native'; function Banner({ type, children, style, textStyle }) { @@ -15,15 +16,15 @@ function Banner({ type, children, style, textStyle }) { } Banner.propTypes = { - type: React.PropTypes.oneOf([ + type: PropTypes.oneOf([ 'success', 'warning', 'error', 'info', ]), - children: React.PropTypes.oneOfType([ - React.PropTypes.string, - React.PropTypes.array, + children: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.array, ]).isRequired, style: View.propTypes.style, textStyle: Text.propTypes.style, diff --git a/tests/src/components/OverviewControlButton.js b/tests/src/components/OverviewControlButton.js index 4fe778bd..dc030dc1 100644 --- a/tests/src/components/OverviewControlButton.js +++ b/tests/src/components/OverviewControlButton.js @@ -1,4 +1,5 @@ -import React, { PropTypes, Component } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import some from 'lodash.some'; import { connect } from 'react-redux'; diff --git a/tests/src/components/StatusIndicator.js b/tests/src/components/StatusIndicator.js index b6180d65..9258bf22 100644 --- a/tests/src/components/StatusIndicator.js +++ b/tests/src/components/StatusIndicator.js @@ -1,5 +1,6 @@ import { View, Text } from 'react-native'; -import React, { PropTypes, Component } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import RunStatus from '../../lib/RunStatus'; import Icon from './Icon'; diff --git a/tests/src/components/TestControlButton.js b/tests/src/components/TestControlButton.js index c11cf98f..daf821c7 100644 --- a/tests/src/components/TestControlButton.js +++ b/tests/src/components/TestControlButton.js @@ -1,4 +1,5 @@ -import React, { PropTypes, Component } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Toast from 'react-native-simple-toast'; diff --git a/tests/src/components/TestSuiteControlButton.js b/tests/src/components/TestSuiteControlButton.js index ca8a0cd3..6ab5223e 100644 --- a/tests/src/components/TestSuiteControlButton.js +++ b/tests/src/components/TestSuiteControlButton.js @@ -1,4 +1,5 @@ -import React, { PropTypes, Component } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Toast from 'react-native-simple-toast';