Interfaces
Last updated
<a href={element.url}>{element.children}</a>import { Node } from 'slate'
// Get the string content of an element node.
const string = Node.string(element)
// Get the node at a specific path inside a root node.
const descendant = Node.get(value, path)import { Range } from 'slate'
// Get the start and end points of a range in order.
const [start, end] = Range.edges(range)
// Check if a range is collapsed to a single point.
if (Range.isCollapsed(range)) {
// ...
}const isImageElement = element => {
return element.type === 'image' && typeof element.url === 'string'
}import { Element } from 'slate'
// You can use `MyElement` everywhere to have access to your extensions.
export const MyElement = {
...Element,
isImageElement,
isParagraphElement,
isQuoteElement,
}