DEV Community

Discussion on: How I Created a Custom Carousel In React using useRef and useState in Typescript

Collapse
anoopfranc profile image
Anoop Francis V H Author

@lukeshiru Thanks for the suggestion,
Thanks for the feedback on nullish coalescing and yes I am trying to improve my naming conventions
The reason Why I used carouselRef is so that if the elements are of different type I can change my prop from JSX.Element[ ] to JSX.Element but still do the functionality.

Once again I really appreciate the feedback and suggestion