Skip to content

Commit 49e84b4

Browse files
nil1511Almouro
authored andcommitted
style: use React.Children.toArray
1 parent e9fcaf1 commit 49e84b4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/withNextInputAutoFocus.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react";
22
import PropTypes from "prop-types";
3-
import { isArray } from "lodash";
43
import withFormik from "./withFormik";
54

65
const withNextInputAutoFocusContextType = {
@@ -10,7 +9,7 @@ const withNextInputAutoFocusContextType = {
109
};
1110

1211
const getInputs = children =>
13-
(isArray(children) ? children : [children]).reduce((partialInputs, child) => {
12+
React.Children.toArray(children).reduce((partialInputs, child) => {
1413
if (child && child.props && child.props.children) {
1514
return partialInputs.concat(getInputs(child.props.children));
1615
}

0 commit comments

Comments
 (0)