Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
react-zoom-pan-pinch with react-slick-slider infinite zoom

I have installed react-zoom-pan-pinch and it conflicts with react-slick because react-zoom-pan-pinch has flex in it. So when I load slides using react-slick it maximizes the image infinitely (I guess). This is code sample:

<TransformWrapper>
    <TransformComponent>
         <MobileZoomImageSlider
               data={variantProducts[selectedProductId]?.images}
         />
    </TransformComponent>
</TransformWrapper>

This must work if width <= 767. Everything works correctly without TransformWrapper and TransformComponent, but this is the task.

Inside this component <MobileZoomImageSlider /> is Slider. Here is the code

export default class MobileZoomImageSlider extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        const settings = {
            dots: true,
            arrows: false,
            infinite: false,
            slidesToShow: 1,
            slidesToScroll: 1,
            touchThreshold: 150,
            speed: 1000,
            responsive: [
                {
                    breakpoint: 767,
                    settings: {
                        slidesToShow: 1
                    }
                }
            ]
        }

        return (<Slider {...settings}>
            {this.props.data?.map((image, index) => (
                <div key={index} className="main-image" >
                    <img
                        src={clientConfig.IMAGE_PATH_L + image + clientConfig.IMAGE_FORMAT}
                        alt=""
                    />
                </div>
            ))
            }
        </Slider>);
    }
}

If I wrap with TransformWrapper and TransformComponent <img src {clientConfig.IMAGE_PATH_L + image + clientConfig.IMAGE_FORMAT} alt="" /> It's not zooming image infinitely BUT slick-slider is not sliding.

If there is any way to turn off flex from these Transformers please let me know guys.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!