Skip to content

Commit 92316d6

Browse files
fix(getInputs): Fix getInputs for <Text> children
1 parent 6867b3e commit 92316d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/withNextInputAutoFocus.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ const withNextInputAutoFocusContextType = {
1212

1313
getInputs = children =>
1414
(isArray(children) ? children : [children]).reduce((partialInputs, child) => {
15-
if (child.props.children) {
15+
if (child.props && child.props.children) {
16+
debugger;
1617
return partialInputs.concat(getInputs(child.props.children));
1718
}
18-
if (child && !!child.props.name) return partialInputs.concat(child);
19+
if (child && child.props && !!child.props.name) return partialInputs.concat(child);
1920
return partialInputs;
2021
}, []);
2122

0 commit comments

Comments
 (0)