Open beorn opened 7 months ago
Using I don't seem to be able to create any custom elements (or HyperscriptShorthands). The documentation is "sparse" :) and the way I think it's supposed to work, the types seem broken:
import { createHyperscript } from "slate-hyperscript" const h = createHyperscript({ elements: { p: { type: "paragraph" }, item: { type: "item" }, text: {} } }) h( "editor", {}, h("cursor"), h("item", {}, h("p", {}, "p1")), )
This results in the attached TS2345 error from TS for the h("item") and h("p") tags.
h("item")
h("p")
I think the tests have perhaps the best examples for using slate-hyperscript, e.g. https://github.com/ianstormtaylor/slate/blob/main/packages/slate/test/operations/set_node/remove-undefined.tsx
Using I don't seem to be able to create any custom elements (or HyperscriptShorthands). The documentation is "sparse" :) and the way I think it's supposed to work, the types seem broken:
This results in the attached TS2345 error from TS for the
h("item")
andh("p")
tags.