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

266
Vistas
Force page to re-render through popup

I am new to React. I have a question about how to force the page to render through a popup.

Now I wrote my page in a function component. And it has a popup window that could change the text on the page. However, the update will first go to the backend database and does not show on the page after submitting the popup form.

I know we can use windows.location.reload to reload the whole page. But I would like to know how I can re-render the function component instead of reloading the whole page.

Thank you so much!

Edit: This is a part of the code from the main page. values and setValues are created by [values, setValues] = useState({name: "", birthDate: ""});.

      <PopUpEdit 
        values={values}
        setValues = {setValues}
        trigger={buttonPopUpEdit} 
        setTrigger={setButtonPopUpEdit}
        >
          Edit
      </PopUpEdit> 

In the popup form,

const onSubmit = async(event)=>{
    event.preventDefault();
    props.setValues(event.target.value);
    props.setTrigger(undefined);
}

Both the main page and the popup form are function components. Thank you!

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

0

in react js everything is based on state. you should add useState hook which is rendered with each change.

See also Basic Hook useState

enter image description here

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