11import { useState , FC } from "react"
22import * as Yup from "yup"
33import { Alert , Button } from "antd"
4- import { useHistory , useLocation } from "react-router"
4+ import { useHistory , useLocation , useParams } from "react-router"
55import { Formik , FormikProps , Form } from "formik"
66
77import { LOGIN } from "routes"
@@ -20,12 +20,9 @@ export type FormValues = {
2020
2121export const ResetPassword : FC = ( ) => {
2222 const history = useHistory ( )
23- const queryParams = new URLSearchParams ( useLocation ( ) . search )
24- const callbackId = queryParams . get ( "callbackId" ) || ""
23+ const { callbackId } = useParams < { callbackId : string } > ( )
2524 const [ matchError , setMatchError ] = useState < boolean > ( false )
2625
27- console . log ( callbackId )
28-
2926 return (
3027 < Formik
3128 initialValues = { {
@@ -53,13 +50,8 @@ export const ResetPassword: FC = () => {
5350 } ) }
5451 >
5552 { ( props : FormikProps < FormValues > ) => {
56- const {
57- values,
58- errors,
59- setFieldValue,
60- submitCount,
61- isSubmitting,
62- } = props
53+ const { values, errors, setFieldValue, submitCount, isSubmitting } =
54+ props
6355 const wasSubmitted = submitCount > 0
6456 setMatchError (
6557 wasSubmitted && values . password !== values . confirmPassword
0 commit comments