Skip to content

Commit

Permalink
Remove the unmount in development since it gives us console log spam, f…
Browse files Browse the repository at this point in the history
  • Loading branch information
lotorvik committed Dec 5, 2023
1 parent 1aacc24 commit 45b7547
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ class FormioReactComponent extends (ReactComponent as unknown as IReactComponent
}

detachReact(element) {
if (element && this.rootElement) {
// For now we prefer memory leak in development over spamming the console log...
// Wrapping in setTimeout causes problems when we do a redraw, so need to find a different solution.
// https://github.com/facebook/react/issues/25675#issuecomment-1518272581
if (element && this.rootElement && process.env.NODE_ENV !== 'development') {
this.rootElement.unmount();
this.rootElement = undefined;
}
}

Expand Down

0 comments on commit 45b7547

Please sign in to comment.