I'm trying to use Swiper
in my Qwik application. Based on the docs I figured out that I have to use useVisibleTask$
.
This is my code:
import {
component$,
useVisibleTask$,
} from '@builder.io/qwik'
import Swiper from 'swiper'
import 'swiper/css'
const Courses = component$(() => {
useVisibleTask$(() => {
const swiper = new Swiper(`.swiper`, {
loop: true,
pagination: {
el: '.swiper-pagination',
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
scrollbar: {
el: '.swiper-scrollbar',
},
})
})
retrun <div>Courses HTML here</div>
})
export default Courses
And this is the error that I get:
vite_ssr_import_1.useVisibleTaskQrl is not a function
What should I do?