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

Function useFeed

  • useFeed(args): PaginatedReadResult<FeedItem[]>
  • Fetch a the feed of a given profile and filters.

    You MUST be authenticated via useLogin to use this hook.

    Parameters

    • args: {
          where?: InputMaybe<FeedWhere>;
      }

      UseFeedArgs

      • Optional where?: InputMaybe<FeedWhere>

    Returns PaginatedReadResult<FeedItem[]>

    Example

    const { data, loading, error } =  useFeed({
    where: {
    for: '0x01`, // profileId
    },
    });

    if (loading) return <div>Loading...</div>;

    if (error) return <div>Error: {error.message}</div>;

    return (
    <ul>
    {data.map((item, idx) => (
    <li key={`${item.root.id}-${idx}`}>
    // render item details
    </li>
    ))}
    </ul>
    );
    • Defined in packages/react/src/discovery/useFeed.ts:60
  • useFeed(args): SuspensePaginatedResult<FeedItem[]>
  • Experimental

    Fetch a the feed of a given profile and filters.

    You MUST be authenticated via useLogin to use this hook.

    This signature supports React Suspense.

    Parameters

    • args: UseSuspenseFeedArgs

      UseSuspenseFeedArgs

    Returns SuspensePaginatedResult<FeedItem[]>

    Example

    const { data, loading, error } =  useFeed({
    where: {
    for: '0x01`, // profileId
    },
    suspense: true,
    });

    return (
    <ul>
    {data.map((item, idx) => (
    <li key={`${item.root.id}-${idx}`}>
    // render item details
    </li>
    ))}
    </ul>
    );

    This API can change without notice

    • Defined in packages/react/src/discovery/useFeed.ts:94

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