FormidableLabs / FormidableLabs/nuka-carousel
Carousel throws error inside server component
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 588
- PR merge metrics
- No merged PRs in 30d
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
### Code Sandbox link
https://codesandbox.io/p/devbox/zcfnc2
### Bug report
```markdown
The Carousel component throws an error when used in a server component in NextJS 15:
> TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it.
This is because the component makes use of a context but is not marked as a client component.
As a work around, I can wrap the Carousel in a client component that just forwards props, but if a context is essential to it's operations it should be marked as a client component with "use client".
```
Contributor guide
Assessment
This issue has not been assessed yet.