Using JSX tools render method
See original GitHub issueHi! I would like to understand if it is possible for tools render
method to return JSX?
For example, I want each paragraph of editor to be my own (already written) React component, which is basically <div>
with contenteditable
attribute, but also with a lots of logic inside. Ideally I would love something like this:
class CustomParagraph {
// other methods here
render() {
return <EditableDiv/>; // where EditableDiv is a big component
}
}
export class NewEditableDiv extends React.Component {
render() {
return <EditorJS
tools={{
paragraph: CustomParagraph
}}
/>;
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Rendering Elements - React
With our knowledge so far, the only way to update the UI is to create a new element, and pass it to root.render()...
Read more >React JSX and Rendering - EASEOUT
Learn about JSX and rendering in React. ... And while it's not mandatory, it's certainly an extremely useful tool — it does a...
Read more >How To Debug React Components Using React Developer ...
A quick way to see how components change each other is to enable highlighting when a component is re-rendered. This will give you...
Read more >JSX in React – Explained with Examples - freeCodeCamp
class JSXDemo extends React.Component { render() { return <h1>This is ...
Read more >How to Render React with optimization - LoginRadius Blog
In React, the render() method is the only required method in a class component and is responsible for describing the view to be...
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 Free
Top 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
Hi @hata6502, you can find a solution (“workaround”) here already: https://github.com/codex-team/editor.js/issues/946#issuecomment-555760936.
Note: this issue is already closed, and a new one discusses this issue.
Hey @natterstefan, it seems, some of inner Editor.js handlers stops event propagation. Definitely we should look into this.
If I select button’s content it works ok:![Screen-Recording-2019-11-12-at-12 55 59](https://user-images.githubusercontent.com/23050529/68661580-3dc20400-054c-11ea-9645-1bddbfdd7541.gif)