cloudinary-community / cloudinary-community/next-cloudinary

[Feature] Bundle `use client` with components

Open
#137 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
300
Forks
137
Avg merge
3m
Merged PRs (30d)
2

Description

# **Feature Request**

## **Is your feature request related to a problem? Please describe.**

To fix [an issue](https://github.com/colbyfayock/next-cloudinary/issues/135) with `use client` not appropriately being added when used in Next.js 13 `app` directory, the directive was [pulled out of the bundle](https://github.com/colbyfayock/next-cloudinary/pull/136) instead recommending adding the `use client` directive to the file.

This isn't ideal, where the hope would be someone could use the components in this library interchangeably without having to worry about that additional distinction

This was a regression when moving to tsup, where however it's being bundled / compiled isn't supported or generally working.

## **Describe the solution you'd like**

`use client` should be bundled with the components that require it, at a minimum `CldImage` as it uses `useState` and I believe it's additionally needed due to the `loader` prop which is a function.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.