Closed iStorry closed 10 months ago
mdxeditor author here, I traced down the problem in the editor to this piece in my code (lives in useEffect):
document.body.appendChild(popupContainer)
editorRootElementRef.current = popupContainer
setEditorRootElementRef(editorRootElementRef)
return () => {
document.body.removeChild(popupContainer)
}
Apparently, by the time the editor is unmounted, the popup container is no longer a direct child of the body element. I find this weird.
This is the fix: https://github.com/mdx-editor/editor/commit/5de52ad2c12eebdfe39f3ddb0f3ae13b857d7243. However, this might cause issues with other libraries who manage popups by moving them to the body.
@petyosi Thank you for the quick response.
Thanks for the quick fix!
When ever i change the language it crashes the application. I can't tell weather it's
MDX
issue ornext-international
I've created the repo with basic fresh project. Please check
https://github.com/iStorry/mdx-next-international-test