Unable to add nested elements #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
My apologies if I've misread the docs, but I would expect
crel('p', {}, ['strong', {}, 'hello'])to return<p><strong>hello</strong></p>similar to prosemirror's toDOM spec. Instead I getRangeError: Unsupported child node: [object Object].That's not how the library works. You want
[crel("strong", "hello")], not the arguments as an array.I figured that part out, but the docs and my prior use of Prosemirror seemed to imply the above could work as well. Thank you for clarifying. Would you be open to a Read Me PR if I can think of a decent one?
The readme states that for array arguments, each element is added separately. I don't think that implies that you can do what you're doing above.
That was actually the part that made me think that crel would operate on arrays like nested arguments, but I appreciate that it was my misunderstanding. I very much enjoy this sublimely lightweight, useful tool.