@lens-protocol/widgets-react
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

Lens Widgets React library

Installation

npm install @lens-protocol/widgets-react

With Next.js

If you are using Next.js pages directory please update your next.config.js with the following:

transpilePackages: ['@lens-protocol'],

So the final configuration might look like this:

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  transpilePackages: ['@lens-protocol']
}
module.exports = nextConfig

Once this update is made, please re-run the server:

npm run dev

Another option when working with Next.js pages directory apps is using a Dynamic Import:

/* Profile created in separate component */
import {
  Profile
} from '@lens-protocol/widgets-react'

export default function ProfileComponent() {
  return (
    <Profile handle='lens/christina' />
  )
}

/* ProfileComponent imported using a dynamic import */
import dynamic from 'next/dynamic'
const ProfileComponent = dynamic(() => import('../components/ProfileComponent'), { ssr: false })

export default () => {
  return (
    <div>
      <ProfileComponent />
    </div>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @lens-protocol/widgets-react

Weekly Downloads

11

Version

2.1.0

License

ISC

Unpacked Size

3.34 MB

Total Files

150

Last publish

Collaborators

  • joshstevens19
  • cnaldi
  • pawel-aave
  • dabit3
  • kris-aave
  • zioid
  • donosonaumczuk
  • npm_avaralabs