Estoy creando un componente de carrusel en React y tengo problemas para implementar la siguiente funcionalidad y la anterior:
const onClickPrevious = () => { const box = opstionsListRef.current.getBoundingClientRect(); opstionsListRef.current.style.transform = `translateX(${box.x - 300}px)`; }; const onClickNext = () => { const box = opstionsListRef.current.getBoundingClientRect(); opstionsListRef.current.style.transform = `translateX(${box.x + 100}px)`; };Tuve que disminuir en 300 solo para tener un translateX más decente, pero aún no funciona correctamente al 100%.