Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
How to use jQuery & Slick in Next.js App?

I want to implement this into my Next.js App

https://codepen.io/Lemonzillah/pen/rmQLRm

I tried to add both libraries needed for this to work in the _document.js file and then link the js code in text-slider from /public

  <Main />
      <NextScript />
      <script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.9/slick.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
      <script src="public/text-Slider.js"></script>

But it ain't working, somehow - it doesn't show any error. It's just now working - hope you can help me!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First of all. It is recommended to not use jquery in react or next js app.

Then if you want to use jquery in next js app you can use next docuemnt..

import Document, { Html, Head, Main, NextScript } from 'next/document'

class MyDocument extends Document {
  static async getInitialProps(ctx) {
    const initialProps = await Document.getInitialProps(ctx)
    return { ...initialProps }
  }

  render() {
    return (
      <Html>
        <Head>
         **Here you can use custom css link or font link like bootstrap cdn
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.9/slick.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
        <script src="public/text-Slider.js"></script>
      </Html>
    )
  }
}

export default MyDocument

You can use now slick by calling slick slider cdns link in script and css. Ans use them. It is recommend to use React slick in next js app

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda