Skip to content

Commit 9864c3a

Browse files
romidaneJames Ide
authored andcommitted
Change getDefaultProps to ES7 property initialiazers for default props (#9241)
and add PropType validation * getDefaultProps is not available in ES6 class style declaration
1 parent e3c81fa commit 9864c3a

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

docs/UsingNavigators.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ import React, { Component } from 'react';
3131
import { View, Text } from 'react-native';
3232

3333
export default class MyScene extends Component {
34-
getDefaultProps() {
35-
return {
36-
title: 'MyScene'
37-
};
38-
}
34+
static propTypes = {
35+
title: React.PropTypes.string,
36+
};
37+
static defaultProps = {
38+
title: 'MyScene',
39+
};
3940

4041
render() {
4142
return (

0 commit comments

Comments
 (0)