EditorJS always renders two editors how to stop it from doing that in nextjs
See original GitHub issueEditorJS always renders two editors how to stop it from doing that in nextjs
I’m using Nextjs with Editor.js how to stop editorjs from rendering 2 editors the image below shows the problem im facing my code and image :-
useEffect(() => {
let editor = { isReady: false };
const Editorjs = require('@editorjs/editorjs')
const Header = require('@editorjs/header');
const SimpleImage = require('@editorjs/simple-image');
const Embed = require('@editorjs/embed');
const Quote = require('@editorjs/quote');
if(!editor.isReady) {
editor = new Editorjs({
holder: 'editorjs',
placeholder: "Start typing",
tools: {
header: {
class: Header,
shortcut: 'ALT+SHIFT+H',
inlineToolbar: ['link' , 'bold'],
},
image: {
class: SimpleImage,
},
embed: {
class: Embed,
inlineToolbar: true,
config: {
services: {
youtube: true,
coub: true,
codepen: {
regex: /https?:\/\/codepen.io\/([^\/\?\&]*)\/pen\/([^\/\?\&]*)/,
embedUrl: 'https://codepen.io/<%= remote_id %>?height=300&theme-id=0&default-tab=css,result&embed-version=2',
html: "<iframe height='300' scrolling='no' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'></iframe>",
height: 300,
width: 600,
}
}
}
},
},
}
)
}
}, [])
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Editor.js rendering/outputting two editors in React
Using useEffect solves the issue since it only runs after the initial page render: export default function index(params) { useEffect(() ...
Read more >Configuration - Editor.js
Editor ready callback. Editor.js needs a bit time to initialize. It is an asynchronous action so it won't block execution of your main...
Read more >Next.js & Editor.js Complete Setup Guide | by Fazley Rabbi
Step 2: Configure & Tools Installation. Each block of Editor.js is provided by a Plugin. By default, Editor.js comes with only a paragraph...
Read more >Ace - The High Performance Code Editor for the Web
Ace is an embeddable code editor written in JavaScript. It matches the features and performance of native editors such as Sublime, Vim and...
Read more >Trying to Setup Monaco Editor with Next.js - Day 14 - YouTube
We got Prismjs working.Code: https://github.com/benawad/codeponderWatch at 6pm CT: https://www.twitch.tv/benawad----If you like cooking, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Instead of disable strict mode, that can be useful for a lot of situations I prefer using a ref to control if Editor has been loaded:
Hope it helps 😄
Thank you for ur solutions, but i fixed this problem myself @santiagoalcazarch