How to use the slate-prop-types.marks function in slate-prop-types

To help you get started, we’ve selected a few slate-prop-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ianstormtaylor / slate / packages / slate-react / src / components / leaf.js View on Github external
}

/**
 * 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 &&

slate-prop-types

A set of React prop type checkers for Slate editors.

MIT
Latest version published 4 years ago

Package Health Score

72 / 100
Full package analysis