Lens Blocks are currently in pre-alpha and not ready for use!

Post Provider Library

A provider of a shared Lens post context for queries and operations.

This library provides a React context provider component called LensPostProvider that manages and supplies Post-related data and functionalities to its child components. The Post context can be accessed using the useLensPostContext hook.

Installation

Usage

import { PostProvider } from "@/lib/lens-post-provider";
import { useSessionClient } from "@lens-protocol/react";
import { useWalletClient } from "wagmi";
const { data: sessionClient } = useSessionClient();
const { data: walletClient } = useWalletClient();
<PostProvider postId={postId} sessionClient={sessionClient} walletClient={walletClient}>
  {/* Child components that consume the post context */}
</PostProvider>