react-splide icon indicating copy to clipboard operation
react-splide copied to clipboard

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

Open esmaeilialireza opened this issue 2 years ago • 2 comments

Checks

  • [X] Not a duplicate.
  • [X] Not a question, feature request, or anything other than a bug report directly related to React Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions

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

esmaeilialireza avatar Sep 15 '23 08:09 esmaeilialireza

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

ioiofadhil avatar Oct 02 '23 13:10 ioiofadhil

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😉

esmaeilialireza avatar Oct 23 '23 18:10 esmaeilialireza