File tree Expand file tree Collapse file tree 2 files changed +10
-15
lines changed
src-ts/tools/work/work-self-service/intake-forms Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -74,12 +74,10 @@ const BugHuntIntakeForm: React.FC = () => {
7474 if ( ! workId && ! challenge ) {
7575 formOnReset ( formInputs , formValues )
7676 }
77- } , [
78- challenge ,
79- formInputs ,
80- formValues ,
81- workId ,
82- ] )
77+ // Disabling lint rule as we only want this to run one time when component mounts, otherwise it resets
78+ // the form for a user that is not logged in and has no challenge created yet
79+ // eslint-disable-next-line react-hooks/exhaustive-deps
80+ } , [ ] )
8381
8482 useEffect ( ( ) => {
8583
Original file line number Diff line number Diff line change @@ -102,22 +102,19 @@ const Review: FC = () => {
102102 } )
103103 }
104104 getAndSetWork ( )
105- } , [
106- formFieldValues ,
107- userProfile ,
108- workId ,
109- ] )
105+ // Disabling to avoid infite re-renders
106+ // eslint-disable-next-line react-hooks/exhaustive-deps
107+ } , [ workId ] )
110108
111109 useEffect ( ( ) => {
112110 setFormValues ( {
113111 ...formFieldValues ,
114112 email : profile ?. email || '' ,
115113 name : `${ profile ?. firstName } ${ profile ?. lastName } ` ,
116114 } )
117- } , [
118- formFieldValues ,
119- profile ,
120- ] )
115+ // Disabling to avoid infite re-renders
116+ // eslint-disable-next-line react-hooks/exhaustive-deps
117+ } , [ profile ] )
121118
122119 const onUpdateField : ( fieldName : string , value : string | boolean ) => void = ( fieldName , value ) => {
123120 setFormValues ( {
You can’t perform that action at this time.
0 commit comments