Преглед изворни кода

update useformik and get values by useEffect from formik form

master
Alex Cheung пре 2 година
родитељ
комит
704ffafa57
2 измењених фајлова са 812 додато и 812 уклоњено
  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 Прегледај датотеку

@@ -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
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


Loading…
Откажи
Сачувај