YIZHUANG / react-multi-carousel

A lightweight production-ready Carousel that rocks supports multiple items and server-side rendering with no dependency. Bundle size 2kb.
MIT License
1.3k stars 292 forks source link

[How To Fix] Warning : correct props name: "partialVisible" as old typo will be removed in future versions! #214

Closed ericklarsen closed 3 years ago

ericklarsen commented 3 years ago

Hi guys, i get some warning like this when I use partialVisible props. How to fix it?

image

And i was trying to look at the types.d.ts file from react-multi-carousel and I found this. image

Why are there 2 parameters with the name PartialVisible? And one of them looks like a typo

Expected behavior The warning is gone

abhinavdalal commented 3 years ago

@ericklarsen i added the second param as the original code had a typo.. i wanted to clean the typo but keep backwards compatibility.. if your getting the warning its because as the warning says your using the old typo prop which will be removed in the next major version update.. just change to using the one without the typo to remove the warnings :)

removing the typo prop is easy but i am sure it will lead to may users facing errors or incorrect functionality.. we want to clean up the typo but at the same time do it in a versioned manner to maintain compatibility.. fixing a typo does not justify a major version release.. hope you understand :)

abhinavdalal commented 3 years ago

i am confused.. you should not be getting warning for partialVisible; this is a mistake..

it should only show for partialVisble

I will need to investigate this!

abhinavdalal commented 3 years ago

https://github.com/YIZHUANG/react-multi-carousel/blob/8786995beea8ec3e04dd026d5bc38b41c78b8eab/src/CarouselItems.tsx#L43

@ericklarsen although the warning says partialVisible needs to be corrected.. the if condition is correct... it is on the typo param that will be deprecated in the future.. so you need to pass correct the param passed.. partialVisble partialVisible

abhinavdalal commented 3 years ago

@ericklarsen @YIZHUANG this issue can be closed!

ericklarsen commented 3 years ago

Thank guys!