Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
/**
* Prop types.
*
* @type {Object}
*/
Leaf.propTypes = {
annotations: ImmutableTypes.list.isRequired,
block: SlateTypes.block.isRequired,
decorations: ImmutableTypes.list.isRequired,
editor: Types.object.isRequired,
index: Types.number.isRequired,
leaves: Types.object.isRequired,
marks: SlateTypes.marks.isRequired,
node: SlateTypes.node.isRequired,
offset: Types.number.isRequired,
parent: SlateTypes.node.isRequired,
text: Types.string.isRequired,
}
/**
* A memoized version of `Leaf` that updates less frequently.
*
* @type {Component}
*/
const MemoizedLeaf = React.memo(Leaf, (prev, next) => {
return (
next.block === prev.block &&
next.index === prev.index &&