Next.js Discord

Discord Forum

Swiper with Nextjs13

Unanswered
Spectacled bear posted this in #help-forum
Open in Discord
Spectacled bearOP
Hello,
im trying to use Swiper in a nextjs 13 application,
in the documents of Swiper it requires to register the custom elements.
the register fucntion should only be called once.
im using the app directory and so i dont have the app.tsx to instantiate the register functin there.
in which component do i call this function ?
https://swiperjs.com/element

// import function to register Swiper custom elements
import { register } from 'swiper/element/bundle';
// register Swiper custom elements
register();

0 Replies