Kaynağa Gözat

update useformik and get values by useEffect from formik form

master
Alex Cheung 2 yıl önce
ebeveyn
işleme
704ffafa57
2 değiştirilmiş dosya ile 812 ekleme ve 812 silme
  1. +8
    -8
      src/pages/authentication/Register.js
  2. +804
    -804
      src/pages/authentication/auth-forms/CustomFormWizard.js

+ 8
- 8
src/pages/authentication/Register.js Dosyayı Görüntüle

@@ -48,12 +48,12 @@ const steps = ['個人資料', '預覽', '完成提交'];
const Register = () => {
const [activeStep, setActiveStep] = useState(0);
const [completed, setCompleted] = useState([false]);
// const [isValid, setisValid] = useState(false);
const [isValid, setisValid] = useState(null);

// const handleIsValidChange = (value) => {
// setisValid(value);
// console.log(value)
// };
const updateValid = (value) => {
setisValid(value);
console.log(value)
};

const totalSteps = () => {
return steps.length;
@@ -139,8 +139,8 @@ const Register = () => {
) : (
<React.Fragment>
<AuthWrapper>
{/* <CustomFormWizard onIsValidChange={handleIsValidChange} step={activeStep} /> */}
<CustomFormWizard step={activeStep} />
<CustomFormWizard updateValid={updateValid} step={activeStep} />
{/* <CustomFormWizard step={activeStep} /> */}
</AuthWrapper>
<Stack direction="row" sx={{ pt: 2 }}>
{ activeStep === totalSteps() - 1 ? (
@@ -177,7 +177,7 @@ const Register = () => {
</Button>
):
(
<Button onClick={handleNext} sx={{ mr: 1 }}>
<Button disabled={isValid===false} onClick={handleNext} sx={{ mr: 1 }}>
繼續
</Button>
)


+ 804
- 804
src/pages/authentication/auth-forms/CustomFormWizard.js
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


Yükleniyor…
İptal
Kaydet