Skip to content

Commit

Permalink
fix: fix JoditEditor returning different types in prod and dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeirojose committed Jun 16, 2024
1 parent 80e447a commit b46e8ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/RichTextEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import React, { Suspense, lazy } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useTheme } from "#/components/ThemeToggle/context";

// @ts-ignore
const JoditEditor = lazy(() => import("jodit-react"));

const JoditEditor = lazy(async () => {
// @ts-ignore
const obj = await import("jodit-react");
return typeof obj.default === "function" ? obj : obj.default;
});
const EDITOR_BUTTONS = [
"undo",
"redo",
Expand Down

0 comments on commit b46e8ea

Please sign in to comment.