Change getDefaultProps to ES7 property initialiazers for default props (#9241)

and add PropType validation

* getDefaultProps is not available in ES6 class style declaration
This commit is contained in:
Steven Bapaga
2016-08-08 05:42:05 +01:00
committed by James Ide
parent e3c81fa5ee
commit 9864c3a0df

View File

@@ -31,11 +31,12 @@ import React, { Component } from 'react';
import { View, Text } from 'react-native';
export default class MyScene extends Component {
getDefaultProps() {
return {
title: 'MyScene'
};
}
static propTypes = {
title: React.PropTypes.string,
};
static defaultProps = {
title: 'MyScene',
};
render() {
return (