-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
dialogsissues related to dialogsissues related to dialogsreactissues related to the react languageissues related to the react language
Description
Bug Description:
In #11669, a fix was provided to support re-opening a ReactDialog that had been closed. However, trying to reopen/reuse a widget that has been previously disposed violates the widget API, which may cause further issues. Especially, BaseWidget.dispose() can only be invoked once, so the reused/revived widget can no longer be disposed after this.
As a consequence, dialogs based on ReactDialog now have an inconsistent lifecycle, which causes errors:
ERROR Warning: You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.
My understanding is that we shouldn't be trying to reuse closed (disposed) Dialogs in the first place; instead, a new instance of the dialog should be created after the previous one was closed/disposed.
Steps to Reproduce:
- In the Theia Browser Example, open the AboutDialog
- Close it using Esc key or X button: Dialog is properly disposed
- Reopen it: Dialog is "successfully" reused, but is still flagged as disposed
- Close it again: Dispose is not properly invoked, because the widget is already disposed
- Reopen it once more: A React error is thrown, because we're trying to mount the dialog again, even though it wasn't successfully unmounted in the previous step
ERROR Warning: You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.
Additional Information
- Operating System: Any
- Theia Version: Tested on 1.33.0, but probably any version >= 1.30.0
Metadata
Metadata
Assignees
Labels
dialogsissues related to dialogsissues related to dialogsreactissues related to the react languageissues related to the react language