5 ms·
Two probably dumb questions, but I can't tell from looking at the examples and a brief scan of the docs: 1) Can this be used as as content-editable substitute?
by mbrookes 9y ago
Two probably dumb questions, but I can't tell from looking at the examples and a brief scan of the docs:
1) Can this be used as as content-editable substitute?
2) What format is the marked-up text stored in, and does it require Slate to be rendered?
- ianstormtaylor 9y agoNot dumb! (Author here.) 1) It depends on what you mean by substitute. It's kind of like a contenteditable that's been implemented with React components and an Immutable.js data model. It's not a drop-in replacement for contenteditable, since the APIs are different. But that is essentially what it lets you do. 2) The data is stored internally in an Immutable.js tree data model. You can convert it to JSON with the built-in `Raw` serializer. And you can define a schema with the `Html` serializer to convert it to HTML, which then you could render anywhere you want. I do this for one of my projects.