Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 1.3 KB

common-errors.mdx

File metadata and controls

44 lines (29 loc) · 1.3 KB
title
Common Errors & Solution

{/* import */} import { Callout } from 'nextra-theme-docs' import { PAGE_HEADING_BOTTOM, HEADING_TOP_SPACER___COMPONENT, HEADING_BOTTOM_SPACER___COMPONENT } from '../../components/spacer.tsx'

{/* Page Heading */}

Common Errors & Solution

<PAGE_HEADING_BOTTOM/>

<HEADING_TOP_SPACER___COMPONENT/>

ReactTextEditor cannot be used as a JSX component

<HEADING_BOTTOM_SPACER___COMPONENT/>

  • This error is not exclusive to this package. It can occur in Next.js projects utilizing TypeScript, especially during the build process.

  • A quick fix to bypass this error is to assign the any type to the "RichTextEditor" component as shown below:

     const RichTextEditor: any = dynamic(
        () => import('rich-text-editor-for-react'),
        {
            ssr: false,
            loading: () => <p>Loading...</p>,
        }
      )
  • However, it's important to note that using the any type will disable the TypeScript type checking for the "RichTextEditor" component, meaning you won't receive proper typing assistance from your IDE.

  • To maintain type safety during development, you might consider using the any type only before building for production, as this error generally doesn't occur in development mode.