From d83bbea57b44afdcc36426e1a97d7193bd5668bc Mon Sep 17 00:00:00 2001 From: Andrew K Date: Sat, 30 Apr 2016 10:33:56 -0400 Subject: [PATCH 1/2] Fixes #14. Children aren't required, but if they are present they must be of type string, node, or element. This should allow nesting of custom elements (icons) inside buttons. --- Button.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Button.js b/Button.js index ad2a794..3d0ea48 100644 --- a/Button.js +++ b/Button.js @@ -1,6 +1,6 @@ 'use strict'; -var React = require('react-native'); +var React = require('react-native'); var { View, TouchableOpacity, @@ -18,7 +18,11 @@ var Button = React.createClass({ { textStyle: Text.propTypes.style, disabledStyle: Text.propTypes.style, - children: PropTypes.string.isRequired, + children: React.PropTypes.oneOfType([ + React.PropTypes.string, + React.PropTypes.node, + React.PropTypes.element + ]), isLoading: PropTypes.bool, isDisabled: PropTypes.bool, activityIndicatorColor: PropTypes.string, From e5a16e980055dc53119be136c0ca134ca978b37b Mon Sep 17 00:00:00 2001 From: Andrew K Date: Sat, 30 Apr 2016 10:35:03 -0400 Subject: [PATCH 2/2] Fixed spacing mistake. --- Button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Button.js b/Button.js index 3d0ea48..b24a89e 100644 --- a/Button.js +++ b/Button.js @@ -1,6 +1,6 @@ 'use strict'; -var React = require('react-native'); +var React = require('react-native'); var { View, TouchableOpacity,