codex-team / codex-team/editor.js

[Bug] Double codex editor in Reactjs

Open
#2,067 16 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

I'am trying to setup `editor.js` in my React app. But there is a weird situation in my project. Let me demonstrate:
![image](https://user-images.githubusercontent.com/89513735/169826750-fce4d980-13d9-4f94-a161-d8eff0f8e3fc.png)
![image](https://user-images.githubusercontent.com/89513735/169826899-2baca69a-7050-4c24-89d7-8e64e950d5b0.png)

There is second `codex-editor` which is I don't need it. Also the second `codex-editor` is also main(?) editor. When I console output, it shows the second editor's values:
![image](https://user-images.githubusercontent.com/89513735/169827756-45ccc120-23eb-4d9a-80e9-690386a8ea99.png)
My React app code:
```
import EditorJS from "@editorjs/editorjs";
import Header from "@editorjs/header";
import List from "@editorjs/list";
import "./App.scss";

function App() {
const editor = new EditorJS({
/**
* Id of Element that should contain the Editor
*/
holder: "editorjs",

/**
* Available Tools list.
* Pass Tool's class or Settings object for each Tool you want to use
*/
tools: {
header: {
class: Header,
inlineToolbar: ["link"],
},
list: {
class: List,
inlineToolbar: true,
},
},
});
const onClickHandler = () => {
editor
.save()
.then((outputData) => {
console.log("Article data: ", outputData.blocks);
})
.catch((error) => {
console.log("Saving failed: ", error);
});
};

return (



Add

);
}

export default App;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.