Splidejs / react-splide

The React component for the Splide slider/carousel.
https://splidejs.com/
MIT License
246 stars 58 forks source link

Nextjs 13 app directory server components not working with react-splide #75

Open esmaeilialireza opened 1 year ago

esmaeilialireza commented 1 year ago

Checks

Version

0.7.12

Description

Hi. It seems react-splide is not working with server components in nextjs 13 app directory. Error says splide uses class components and only works in client components. Screenshot 2023-09-14 162450

Reproduction Link

No response

Steps to Reproduce

Used in server components

Expected Behaviour

Work with server components

ioiofadhil commented 1 year ago

Is SplideJS itself a client-side library? Just use "use client" in your components... CMIIW

esmaeilialireza commented 1 year ago

The slider must render on the server side because there are some data that must rendered on the server for SEO. BTW I know that I should use "use client" for client components😉