Uncaught Error when quickly mounted and unmounted

This issue has been tracked since 2022-10-25.

Unmounting the editor immediately after it's mounted causes an error to be thrown afterwards, making Cypress tests fail.

import { useEffect, useState } from "react";
import EmailEditor from "react-email-editor";

export default function Test() {
  const [mount, setMount] = useState(true);
  useEffect(() => setMount(false), []);
  return mount && <EmailEditor editorId="editor" />;
Uncaught Error: Could not find a valid element for given id or className.
    at e.value (embed.js?2:1:18685)
    at e.value (embed.js?2:1:17937)
    at new e (embed.js?2:1:17790)
    at a.value (embed.js?2:1:29286)
    at _this.loadEditor (index.js:42:30)
    at runCallbacks2 (loadScript.js:27:7)
    at embedScript.onload (loadScript.js:42:7)
More Details About Repo
Owner Name unlayer
Repo Name react-email-editor
Full Name unlayer/react-email-editor
Language JavaScript
Created Date 2017-10-01
Updated Date 2022-12-05
Star Count 3598
Watcher Count 48
Fork Count 627
Issue Count 163


Issue Title Created Date Updated Date