# @lens-protocol/widgets-react

> React widgets to easily integrate Lens into your app

Latest version **2.1.0** (published 2023-12-04) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @lens-protocol/widgets-react
pnpm add @lens-protocol/widgets-react
yarn add @lens-protocol/widgets-react
bun add @lens-protocol/widgets-react
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2023-12-04 |
| First published | 2023-02-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 3.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 89 |
| Maintainers | reecejohnson, joshstevens19, cnaldi, pawel-aave, dabit3, kris-aave, zioid, donosonaumczuk, npm_avaralabs |

## Links

- npm: https://www.npmjs.com/package/@lens-protocol/widgets-react
- Repository: https://github.com/lens-protocol/lens-widgets.git#main
- Homepage: https://github.com/lens-protocol/lens-widgets/tree/main#readme
- Issues: https://github.com/lens-protocol/lens-widgets/issues
- npm.io page: https://npm.io/package/@lens-protocol/widgets-react

## Dependencies (10)

- [urql](https://npm.io/package/urql.md) ^3.0.3
- [ethers](https://npm.io/package/ethers.md) ^5.7.2
- [graphql](https://npm.io/package/graphql.md) ^16.6.0
- [date-fns](https://npm.io/package/date-fns.md) ^2.29.3
- [rehype-raw](https://npm.io/package/rehype-raw.md) ^6.1.1
- [typescript](https://npm.io/package/typescript.md) ^4.9.5
- [@emotion/css](https://npm.io/package/@emotion/css.md) ^11.10.5
- [@types/react](https://npm.io/package/@types/react.md) ^18.0.28
- [react-player](https://npm.io/package/react-player.md) ^2.12.0
- [react-markdown](https://npm.io/package/react-markdown.md) ^8.0.6

## Recent versions

- 2.1.0 (latest) — 2023-12-04
- 2.0.9 — 2023-11-27
- 2.0.8 — 2023-11-14
- 2.0.7 — 2023-11-13
- 2.0.6 — 2023-11-13
- 2.0.5 — 2023-11-13
- 2.0.4 — 2023-11-13
- 2.0.3 — 2023-11-13
- 2.0.2 — 2023-11-13
- 2.0.1 — 2023-11-09
- 0.0.34 — 2023-09-08
- 0.0.33 — 2023-09-08
- 0.0.32 — 2023-08-31
- 0.0.31 — 2023-07-31
- 0.0.30 — 2023-07-26
- … 20 more at https://npm.io/package/@lens-protocol/widgets-react/versions

## README

## Lens Widgets React library

### Installation

```sh
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:

```javascript
transpilePackages: ['@lens-protocol'],
```

So the final configuration might look like this:

```javascript
/** @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:

```sh
npm run dev
```

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

```typescript
/* 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>
  )
}
```

---
_Source: https://npm.io/package/@lens-protocol/widgets-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
