merge formData with current in Stepper onChange

Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
Paul Cowan
2022-12-23 10:57:31 +00:00
parent 4e5bd31242
commit 0b0bd3379b
@@ -102,7 +102,8 @@ export const Stepper = (props: StepperProps) => {
};
const handleChange = useCallback(
(e: IChangeEvent) => setFormState(e.formData),
(e: IChangeEvent) =>
setFormState(current => ({ ...current, ...e.formData })),
[setFormState],
);