• Preparing search index...
  • The search index is not available
Lens SDK Reference
  • Lens SDK Reference
  • @lens-protocol/react-native
  • Core
  • useHideCommentToggle

Function useHideCommentToggle

  • useHideCommentToggle(): UseDeferredTask<void, never, UseHideCommentToggleArgs>
  • This hook enables the author of a publication to toggle the visibility of a comment on their publication.

    You MUST be authenticated via useLogin to use this hook.

    Returns UseDeferredTask<void, never, UseHideCommentToggleArgs>

    Example

    import { Comment, useHideCommentToggle } from '@lens-protocol/react-web';

    function HideableComment({ comment }: { comment: Comment }) {
    const { execute: toggle, loading } = useHideCommentToggle();

    return (
    <button onClick={() => toggle({ comment })} disabled={loading}>
    {comment.hiddenByAuthor ? 'Unhide' : 'Hide'}
    </button>
    );
    }
    • Defined in packages/react/src/publication/useHideCommentToggle.ts:35

Settings

Member Visibility

Theme

Lens SDK Reference
  • @lens-protocol/react-web - v2.3.2
  • @lens-protocol/react-native - v2.3.2
  • @lens-protocol/client - v2.3.2