@@ -10,7 +10,7 @@ import { Button, Input } from './styled';
1010import  {  setCollapse  }  from  './settingAction' ; 
1111
1212export  default  ( { 
13-   control : {  fieldsRef,  getValues,  formState ,  errorsRef ,  readFormStateRef  } , 
13+   control : {  fieldsRef,  getValues,  readFormStateRef ,  formStateRef  } , 
1414} : { 
1515  control : Control ; 
1616} )  =>  { 
@@ -107,13 +107,14 @@ export default ({
107107              name , 
108108          ) 
109109          . map ( ( [ name ,  value ] ,  index )  =>  { 
110-             const  error  =  get ( errorsRef . current ,  name ) ; 
110+             const  error  =  get ( formStateRef . current . errors ,  name ) ; 
111111            const  errorMessage  =  get ( error ,  'message' ,  undefined ) ; 
112112            const  errorType  =  get ( error ,  'type' ,  undefined ) ; 
113113            const  type  =  get ( value ,  'ref.type' ,  undefined ) ; 
114-             const  isTouched  =  ! ! get ( formState . touched ,  name ) ; 
114+             const  isTouched  =  ! ! get ( formStateRef . current . touched ,  name ) ; 
115115            const  isNative  =  ( value  as  any ) . ref . type ; 
116-             const  isDirty  =  ! ! Object . keys ( formState . dirtyFields ) . length ; 
116+             const  isDirty  =  ! ! Object . keys ( formStateRef . current . dirtyFields ) 
117+               . length ; 
117118            const  hasError  =  ! ! error ; 
118119            const  ref  =  get ( value ,  'ref' ) ; 
119120
@@ -147,7 +148,7 @@ export default ({
147148
148149      < FormStateTable 
149150        readFormStateRef = { readFormStateRef } 
150-         formState = { formState } 
151+         formState = { formStateRef . current } 
151152        showFormState = { showFormState } 
152153        setShowFormState = { setShowFormState } 
153154      /> 
0 commit comments