diff --git a/src/Modal.js b/src/Modal.js index 47f06a865..334911df8 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -1,18 +1,32 @@ -import React, { Component, View } from 'react-native'; +import React, { + PropTypes, + View, +} from 'react-native'; import DefaultRenderer from './DefaultRenderer'; -export default class extends Component { - render() { - const children = this.props.navigationState.children; - const state = children[0]; - return ( - - {children.length > 1 && children.map((el, i) => { - if (i > 0 && el.component) { - const Component = el.component; - return ; - } - })} - ); - } +const propTypes = { + navigationState: PropTypes.shape({ + children: PropTypes.array, + }), +}; + +export default function Modal(props: Object) { + const children = props.navigationState.children; + const state = children[0]; + + return ( + + + {children.length > 1 && children.map((el, i) => { + if (i > 0 && el.component) { + const Component = el.component; + return ; + } + + return null; + })} + + ); } + +Modal.propTypes = propTypes;