Guides

usePublication

usePublication is a React hook that allows you to find a specific publication using it's identifier.

const { data, loading } = usePublication(args)

Usage

import { usePublication } from '@lens-protocol/react-web';

function Publication() {
const { data: publication, loading } = usePublication({
    publicationId: '0x77-0x0149',
  });
}

Reference

usePublication(args)

Parameters

  • publicationId (required)

The id of the publication to fetch

  • observerId (optional)

The id of the profile who is running the query, usually the logged in/active profile.

Returns

{
  data: PublicationFragment,
  loading: boolean
}