0

Link I am using JSME React npm package for using JSME editor to run on my app. this package is working perfectly fine in reactjs. But not working in nextjs project. can anyone point out where I am doing wrong. Whenever i install in a next js problem and run the app i am getting JSME initialization error: HTML id jsme11798 not found Error in console and the editor is not visible.

import React, { useEffect } from "react";
import { Jsme } from "jsme-react";

function Editor() {
  return (
    <div>
      <Jsme height="300px" width="400px" options="oldlook,star" />
    </div>
  );
}

export default Editor;

enter image description here

1 Answer 1

2

Most of the editors need to run on browser, try to import Editor component on client side only. Documentaion

In your page file:

import dynamic from 'next/dynamic'

const Editor= dynamic(
  () => import('../components/Editor'), //Editor component path
  { ssr: false }
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.