Sanity Library Reference Docs
    Preparing search index...

    Function useIntentLink

    • Returns props for an anchor element that will trigger an intent when clicked.

      Parameters

      Returns { href: string; onClick: MouseEventHandler<HTMLElement> }

      • An object with onClick and href props to use for the link
      const {onClick, href} = useIntentLink({
      intent: 'edit',
      params: {id: 'foo'}
      })

      <a href={href} onClick={onClick}>Link to "foo" editor</a>