Skip to content

Commit 2cda5bd

Browse files
fix(children): fix the crash when only one children (#1016)
1 parent 44cbed2 commit 2cda5bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ export default class extends Component {
244244
}
245245

246246
// Support Optional render page
247-
initState.children = props.children.filter(child => child)
247+
initState.children = Array.isArray(props.children)
248+
? props.children.filter(child => child)
249+
: props.children
248250

249251
initState.total = initState.children ? initState.children.length || 1 : 0
250252

0 commit comments

Comments
 (0)