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

596
Vistas
SSRProvider is not working in my NextJs app

My app is built using NextJs with Typescript and using the react-bootstrap library for components. I keep getting an error that says When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.

I tried to include the SSRProvider that comes with react-bootstrap, but it doesn't seem to be working no matter where I put it in my _app.tsx file. Anyone know how to resolve this? My UI keeps breaking when reloading the page.

import type { NextComponentType } from 'next';
import { AppContext, AppInitialProps, AppLayoutProps } from 'next/app';
import { ReactNode } from 'react';
import { ThemeProvider } from 'styled-components';
import theme from '../styles/theme';
import { SSRProvider } from 'react-bootstrap';

const MyApp: NextComponentType<AppContext, AppInitialProps, AppLayoutProps> = ({
  Component,
  pageProps,
}: AppLayoutProps) => {
    const getLayout = Component.getLayout || ((page: ReactNode) => page);

  return (
      getLayout(
      <SSRProvider>
        <ThemeProvider theme={theme}>
          <Component {...pageProps} />
        </ThemeProvider>
      </SSRProvider>
      )
    )
}

export default MyApp;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Fixed this by wrapping the entire return statement in the <SSRProvider> tag. Last time I tried that, I forgot to wrap the getLayout() statement in curly braces. Here is the code for anyone running into the same issue.

return (
      <SSRProvider>
      {getLayout(
        <ThemeProvider theme={theme}>
          <Component {...pageProps} />
        </ThemeProvider>
      )}
      </SSRProvider>
    )
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