'React Monaco Editor layout error, after editor.dispose and editor.getModel().dispose()

enter image description here

Unmount callback function called editor.dispose(); editor.getModel().dispose();.
While visiting the editor page again, the layout became like this picture.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source