Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@ const BugHuntIntakeForm: React.FC = () => {
if (!workId && !challenge) {
formOnReset(formInputs, formValues)
}
}, [
challenge,
formInputs,
formValues,
workId,
])
// Disabling lint rule as we only want this to run one time when component mounts, otherwise it resets
// the form for a user that is not logged in and has no challenge created yet
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

useEffect(() => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,19 @@ const Review: FC = () => {
})
}
getAndSetWork()
}, [
formFieldValues,
userProfile,
workId,
])
// Disabling to avoid infite re-renders
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [workId])

useEffect(() => {
setFormValues({
...formFieldValues,
email: profile?.email || '',
name: `${profile?.firstName} ${profile?.lastName}`,
})
}, [
formFieldValues,
profile,
])
// Disabling to avoid infite re-renders
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [profile])

const onUpdateField: (fieldName: string, value: string | boolean) => void = (fieldName, value) => {
setFormValues({
Expand Down