Skip to content
Discussion options

You must be logged in to vote

The type does nothing at run time. useEditorState gives ctx to your selector, and ctx.editor is your editor:

export default function editorMenuStateSelector(ctx) {
  return {
    isBold: ctx.editor.isActive('bold') ?? false,
    canBold: ctx.editor.can().chain().toggleBold().run() ?? false,
  }
}

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@creativeknightl0
Comment options

@g4lb
Comment options

Answer selected by creativeknightl0
@creativeknightl0
Comment options

@creativeknightl0
Comment options

@g4lb
Comment options

@creativeknightl0
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants