diff --git a/.eslintrc.js b/.eslintrc.js index 83464d16a..ae71afb07 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,6 +7,7 @@ module.exports = { 'plugin:vitest-globals/recommended', 'plugin:cypress/recommended', 'prettier', + 'plugin:react-hooks/recommended', ], parser: '@typescript-eslint/parser', plugins: ['react', 'react-hooks', 'import', '@typescript-eslint', 'vitest', 'cypress'], diff --git a/packages/shared-components/src/context/prefill-data/PrefillDataContext.tsx b/packages/shared-components/src/context/prefill-data/PrefillDataContext.tsx index 4199e32a7..f49a59b37 100644 --- a/packages/shared-components/src/context/prefill-data/PrefillDataContext.tsx +++ b/packages/shared-components/src/context/prefill-data/PrefillDataContext.tsx @@ -36,7 +36,7 @@ export const PrefillDataProvider = ({ children, form }: PrefillDataProviderProps if (fyllutPrefillData) setPrefillData(fyllutPrefillData); }; loadPrefillData(form); - }, []); + }, [baseUrl, form, http, submissionMethod]); return {children}; }; diff --git a/packages/shared-components/src/pages/fill-in-form/FillInFormPage.tsx b/packages/shared-components/src/pages/fill-in-form/FillInFormPage.tsx index 5a369ab7b..6aad872dd 100644 --- a/packages/shared-components/src/pages/fill-in-form/FillInFormPage.tsx +++ b/packages/shared-components/src/pages/fill-in-form/FillInFormPage.tsx @@ -58,7 +58,7 @@ export const FillInFormPage = ({ form, submission, setSubmission, formUrl }) => } setFormForRendering(formToRender); - }, [form, submissionMethod, prefillData]); + }, [form, submissionMethod, prefillData, submission]); useEffect(() => { loggSkjemaApnet(submissionMethod);