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

219
Vistas
React-Hook Form and Little State Machine: Am I clearing up these states properly?

In this codesandbox, I can still see the previous values that were saved. However, if I'll use an incognito, the codesandbox is working properly. It does not show the previous values that were submitted.

This is the codesandbox: https://codesandbox.io/s/react-hook-form-data-in-step-1-and-step-2-editing-the-variable-names-wgv169?file=/src/Step2.js

Clearing up the state:

export default function clearAction(state, payload) {
  return {
    data: {}
  };
}

const Step2 = (props) => {
  const { state, action } = useStateMachine(updateAction, clearAction);
  const onSubmit = (data) => {
    action(data);
    action();
    push("/result");
  };

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
    //input fields here
    </form>
  );
};
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