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

218
Vistas
NOT getting updated content with every render

I'm new to Next.js. I'm facing a problem where I am not able to load my new content on the page. Next.js keeps showing the old content which I already deleted from the code. Why does prior content show?

Here is the last code which I delete but still it is showing on the source tab of chrome.

export const UploadWrapper = () => {
    // const img__isClicked = ;
    const img__isClicked = useSelector(state => state);

    useEffect(() => {
        console.log('uploadWrapper', img__isClicked);
    }, [img__isClicked])

    return (
        <section>
            <UploadDropzone />
            {(img__isClicked) ? console.log('hurray I got you') : null }
        </section>
    )
}

Here is the updated code which is not showing on the page:

export const UploadWrapper = () => {
    // const img__isClicked = ;
    const img__isClicked = useSelector(state => state.img__isClicked);

    useEffect(() => {
        console.log('uploadWrapper', img__isClicked);
    }, [img__isClicked])

    return (
      <>
        <section>
            <UploadDropzone />
        </section>
        <aside>
            {(img__isClicked === true) ? <TagsWrapper /> : null }
        </aside>
      </>
    )
}

If I wish to see fresh content then I have to restart the whole server again.

event the console is showing me

Hurray I got you

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

0

It is because new render doesn't happen when you don't change the state inside the component. You could create imgClicked state like this:

export const UploadWrapper = () => {
  const [imgClicked, setImageClicked] = useState(false);
  const img__isClicked = useSelector(state => state.img__isClicked);

  useEffect(() => {
    setImageClicked(img__isClicked); // <--- This state change will trigger re-render of the component.
  }, [img__isClicked])

  return (
    <>
      {imgClicked ? <TagsWrapper /> : null}
    </>
  )
}

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