RNTester: Remove all but one instance of PropTypes (#21321)

Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes all but one instance of PropTypes in `RNTester`. The last remaining conversion is `CameraRollView`, which I will do in a separate PR.
Pull Request resolved: https://github.com/facebook/react-native/pull/21321

Differential Revision: D10041809

Pulled By: TheSavior

fbshipit-source-id: c03b1ce5ad640ae59ae6240a3b6c13581345b5a3
This commit is contained in:
empyrical
2018-09-25 17:04:38 -07:00
committed by Facebook Github Bot
parent 6bcc1dfcc8
commit ae1817fdb9
4 changed files with 60 additions and 80 deletions

View File

@@ -9,17 +9,22 @@
'use strict';
var React = require('react');
var PropTypes = require('prop-types');
var ReactNative = require('react-native');
var {Linking, StyleSheet, Text, TouchableOpacity, View} = ReactNative;
var RNTesterBlock = require('./RNTesterBlock');
const React = require('react');
const {
Linking,
StyleSheet,
Text,
TouchableOpacity,
View,
} = require('react-native');
class OpenURLButton extends React.Component {
static propTypes = {
url: PropTypes.string,
};
const RNTesterBlock = require('./RNTesterBlock');
type Props = $ReadOnly<{|
url?: ?string,
|}>;
class OpenURLButton extends React.Component<Props> {
handleClick = () => {
Linking.canOpenURL(this.props.url).then(supported => {
if (supported) {
@@ -59,7 +64,7 @@ class IntentAndroidExample extends React.Component {
}
}
var styles = StyleSheet.create({
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',