Hello everyone,
I'm trying to implement a hook called useCarousel to have a carousel in an easy way without adding too much logic/animations to my components.
The problem is that I've encountered many "bugs" with the state, because it doesn't update !
I use several useEffect and useCallback in my code, but I'm sure that I've implemented them properly so they should be working !
You can have a simple example with the handleDrag function, triggered from the onDrag parameter in my Draggable options.
Originally, my direction state is 0, I update the state with setDirection to "ok" just to see any difference, but nothing, still getting 0 in the console.log.
Anyone have an idea of what's causing this ?