daisyui / react-daisyui

daisyUI components built with React 🌼
http://react.daisyui.com/
MIT License
943 stars 103 forks source link

Carousel control button #282

Closed Xoaib007 closed 1 year ago

Xoaib007 commented 1 year ago

Screenshot 2022-12-25 230148

Carousel control buttons uses anchor tag which cause re-rendering the page. Which is inappropriate in a single page project with react.

benjitrosch commented 1 year ago

Hi @Xoaib007,

I think there may be some misunderstanding. The code snippet you've posted belongs to https://daisyui.com/components/carousel/, which is different from the React based version found on https://react.daisyui.com/?path=/story/data-display-carousel--sequential.

The React version appropriately uses a <button> by default, and allows the user to pass in any custom button they would like to use. The anchor tag makes sense for the non-React daisyui example.

Xoaib007 commented 1 year ago

Hi @Xoaib007,

I think there may be some misunderstanding. The code snippet you've posted belongs to https://daisyui.com/components/carousel/, which is different from the React based version found on https://react.daisyui.com/?path=/story/data-display-carousel--sequential.

The React version appropriately uses a <button> by default, and allows the user to pass in any custom button they would like to use. The anchor tag makes sense for the non-React daisyui example.

Thanks man, I didnt know daisyui have a dedicated react based version. I've been using wrong thing for almost 8 months :)