I need to know the width of each slide in the carousel to make the height the same. That way every element of the slider will be square.
I tried to find information in the documentation. I didn't find anything I needed.
I got this solution
const [ref, internalSlider] = useKeenSlider({...})
const slideHeight = internalSlider.current?.slides?.[0]?.clientWidth;
<div ref={ref} className="keen-slider">
{slides.map(slide => (
<div style={{ height: slideHeight }}/>
)}
</div>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.