Skip to main content

MentionMatcher

Hierarchy

Index

Constructors

constructor

Properties

factory

factory: null | ComponentType<MentionProps>

greedy

greedy: boolean

inverseName

inverseName: string

options

options: {}

propName

propName: string

Methods

asTag

  • asTag(): string

createElement

  • createElement(children: ChildrenNode, props: MentionProps): Node
  • Attempts to create a React element using a custom user provided factory, or the default matcher factory.

doMatch

  • doMatch<T>(string: string, pattern: string | RegExp, callback: MatchCallback<T>, isVoid?: boolean): null | MatchResponse<T>
  • Trigger the actual pattern match and package the matched response through a callback.


    Type parameters

    • T

handleMatches

  • handleMatches(matches: string[]): { mention: string }

match

  • match(string: string): null | MatchResponse<{ mention: string }>

onAfterParse

  • Callback triggered after parsing.

onBeforeParse

  • Callback triggered before parsing.

replaceWith

  • replaceWith(children: ChildrenNode, props: MentionProps): Node