Skip to content
Merged
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
9 changes: 7 additions & 2 deletions src/SplitPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function getDefaultSize(defaultSize, minSize, maxSize, draggedSize) {
return minSize;
}

function removeNullChildren(children) {
return React.Children.toArray(children).filter(c => c);
}
class SplitPane extends React.Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -292,6 +295,8 @@ class SplitPane extends React.Component {
? `${resizerClassName} ${RESIZER_DEFAULT_CLASSNAME}`
: resizerClassName;

const notNullChildren = removeNullChildren(children);

const style = Object.assign(
{},
{
Expand Down Expand Up @@ -354,7 +359,7 @@ class SplitPane extends React.Component {
split={split}
style={pane1Style}
>
{children[0]}
{notNullChildren[0]}
</Pane>
<Resizer
className={disabledClass}
Expand All @@ -378,7 +383,7 @@ class SplitPane extends React.Component {
split={split}
style={pane2Style}
>
{children[1]}
{notNullChildren[1]}
</Pane>
</div>
);
Expand Down