You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a form for a family card with details and tabs such as phones, receipt details, etc.
When I get the family details from the redux, I initialize the initialValues with the family details without the tab details.
After that , the user can change values and when he clicks on one of the tabs such as phones, the phones details comes from the Redux and only then I want to add it to initailValues, without affecting the user's updates on the family details. Is it possible?
my code is 👍
const {
title,
family,
contactDetails,
phone /, newFamily, sameFamily, copyValues,/,
touchedValues,
saveSubmited,
} = useSelector((state) => state.families);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a form for a family card with details and tabs such as phones, receipt details, etc.
When I get the family details from the redux, I initialize the initialValues with the family details without the tab details.
After that , the user can change values and when he clicks on one of the tabs such as phones, the phones details comes from the Redux and only then I want to add it to initailValues, without affecting the user's updates on the family details. Is it possible?
my code is 👍
const {
title,
family,
contactDetails,
phone /, newFamily, sameFamily, copyValues,/,
touchedValues,
saveSubmited,
} = useSelector((state) => state.families);
const [initialValues, setInitialValues] = useState({});
const handleSubmit = async (
values,
{ setSubmitting, resetForm, setTouched, setFieldValue, dirty }
) => {
console.log(values);
};
useEffect(() => {
if (familyId !== "new") {
!title && dispatch(actions.getShortFamilyDetails(familyId));
}, [familyId]);
useEffect(() => {
if (!family) return;
}, [family]);
useEffect(() => {
if (!phone) return;
}, [phone]);
const { formId, formField } = familyFormModel;
return (
//
);
};
export default FamilyFormik;
thanks
Beta Was this translation helpful? Give feedback.
All reactions