diff --git a/lib/Paneset/Paneset.js b/lib/Paneset/Paneset.js index c6c96e2cb..838dbbd75 100644 --- a/lib/Paneset/Paneset.js +++ b/lib/Paneset/Paneset.js @@ -442,10 +442,15 @@ class Paneset extends React.Component { this.interval = null; }); } else { - // insert sorted by left coordinate of clientrect... - const newPanes = insertByClientRect(newState.panes, paneObject); - newState = Object.assign(newState, { panes: newPanes, changeType: 'added' }); - // newState = this.insertPaneObject(newState, paneObject); + // check for duplicate id's before registering. Registration happens on mount. + // This will help with mount-twice strict mode strangeness + const paneExists = newState.panes.findIndex((p) => p.id === paneObject.id) + if (paneExists === -1) { + // insert sorted by left coordinate of clientrect... + const newPanes = insertByClientRect(newState.panes, paneObject); + newState = Object.assign(newState, { panes: newPanes, changeType: 'added' }); + // newState = this.insertPaneObject(newState, paneObject); + } } return newState; }, () => {