diff --git a/lib/build/emailpassword-shared7.js b/lib/build/emailpassword-shared7.js index b2430ed7c..aec97b722 100644 --- a/lib/build/emailpassword-shared7.js +++ b/lib/build/emailpassword-shared7.js @@ -471,7 +471,11 @@ var FormBase = function (props) { }, [unmounting] ); - var _a = React.useState([]), + var _a = React.useState( + props.formFields.map(function (f) { + return { id: f.id, value: "" }; + }) + ), fieldStates = _a[0], setFieldStates = _a[1]; var _b = React.useState(false), diff --git a/lib/ts/recipe/emailpassword/components/library/formBase.tsx b/lib/ts/recipe/emailpassword/components/library/formBase.tsx index 14d540e11..7ea1d2510 100644 --- a/lib/ts/recipe/emailpassword/components/library/formBase.tsx +++ b/lib/ts/recipe/emailpassword/components/library/formBase.tsx @@ -68,7 +68,9 @@ export const FormBase: React.FC> = (props) => { }; }, [unmounting]); - const [fieldStates, setFieldStates] = useState([]); + const [fieldStates, setFieldStates] = useState( + props.formFields.map((f) => ({ id: f.id, value: "" })) + ); const [isLoading, setIsLoading] = useState(false); useEffect(() => {