diff --git a/src/withNextInputAutoFocus.js b/src/withNextInputAutoFocus.js index ee5dc0e..1f6b57b 100644 --- a/src/withNextInputAutoFocus.js +++ b/src/withNextInputAutoFocus.js @@ -10,7 +10,7 @@ const withNextInputAutoFocusContextType = { getReturnKeyType: PropTypes.func }; -getInputs = children => +const getInputs = children => (isArray(children) ? children : [children]).reduce((partialInputs, child) => { if (child.props && child.props.children) { return partialInputs.concat(getInputs(child.props.children));