Skip to content

Commit a22c534

Browse files
Merge pull request #15 from bamlab/taboulot-patch-1
fix(getInputs): Fix getInputs for <Text> children
2 parents 6867b3e + a0dd9d4 commit a22c534

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/withNextInputAutoFocus.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ 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) {
1616
return partialInputs.concat(getInputs(child.props.children));
1717
}
18-
if (child && !!child.props.name) return partialInputs.concat(child);
18+
if (child && child.props && !!child.props.name) return partialInputs.concat(child);
1919
return partialInputs;
2020
}, []);
2121

0 commit comments

Comments
 (0)