D
D
Daniel Chistyakov2021-04-18 21:52:10
React
Daniel Chistyakov, 2021-04-18 21:52:10

How to implement Lazy Load in React in Swiper Slider?

I tried to make a Lazy Load, but I can't figure out why the photos still don't load. Maybe someone knows what's wrong. The documentation describes only the version with HTML / JS.
Link to CodeSandbox

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-04-18
@danielchistyakov

You need to import the Lazy module: . You didn't. Connect it: . You didn't. Indicate to the slider instance that lazy loading is required: . You didn't. Add class to images , replace attribute with . Well, at least you have it. import { Lazy } from 'swiper';
swiper-lazysrcdata-src

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question