Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion SmartScrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class SmartScrollView extends Component {
}

function recursivelyCheckAndAdd(children, i) {
return React.Children.map(children, (child, j) => {
const result = React.Children.map(children, (child, j) => {
if (child && child.props !== undefined) {
if (child.props.smartScrollOptions !== undefined) {
return smartClone(child, ''+i+j);
Expand All @@ -210,6 +210,10 @@ class SmartScrollView extends Component {
return child
}
})

if (result.length === 1) return result[0]

return result
}

const content = recursivelyCheckAndAdd(scrollChildren, '0');
Expand Down