From 1b7113627d421f58885625851241d0be0a93f4cb Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Sun, 21 Feb 2021 16:27:39 +0200 Subject: Copy state instead changing original --- src/store/form/reducers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/form/reducers.ts b/src/store/form/reducers.ts index 21bd047..d7d3388 100644 --- a/src/store/form/reducers.ts +++ b/src/store/form/reducers.ts @@ -9,7 +9,7 @@ export const initialState: FormState = { }; export function formReducer(state = initialState, action: Action): FormState { - const new_state = state; + const new_state = {...state}; switch (action.type) { case FormAction.SET_VALUE: new_state.values.set(action.payload.question.id, action.payload.value); -- cgit v1.2.3