SectionX debería mostrar los mismos valores que el segundo archivo console.log. Puede ver que cuando registro accesorios y sectionRef.current, obtengo los mismos valores... Pero sectionRef.current viene con un (flex).
const horizontalScroll = (props) => { var container = document.getElementById(styles["a-text__box"]); var sectionX = props.getBoundingClientRect().x; console.log(sectionX); console.log(sectionRef.current.getBoundingClientRect().x); console.log(props); console.log(sectionRef.current); // container.scrollTo({ // top: 0, // left: sectionX, // behavior: "smooth", // }); };CONSOLA:
0 1193.28125 <div>...</div> <div>...</div>(flex)