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

269
Vistas
Nextjs css not working properly after router.push()

It's my first project in nextJS so please don't blame me if it's super basic stuff. The problem is if person go to the home page it will redirect him to login page if his not authenticated. And login page is inheriting background picture from index page which isn't supposed to. And after logging in and going back to index page. Index page's background picture is half cut. Can't insert pictures because of my reputation :<

Here is how I'm adding background image to home page

<body style={{
    backgroundImage: "url('https://images4.alphacoders.com/480/thumb-1920-48076.jpg')"
}}>`

It's how I'm routing

useEffect(() => {
if (loading) {
return;
}
if (user){ 
console.log('logged in');
fetchData(user.uid)}
else{
router.push("/login");}}, [user, loading]);```

Thank you.

I have no idea how to solve this. I added 2 different body css code to these pages.

about 4 years ago · Juan Pablo Isaza
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