Skip to content

Commit

Permalink
fix usage of firstRender
Browse files Browse the repository at this point in the history
  • Loading branch information
Matushl committed Nov 23, 2024
1 parent 4544601 commit ac0fc9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/SchoolSubForm/SchoolSubForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const SchoolSubForm = ({control, watch, setValue, gap}: SchoolSubFormProp

// predvyplnenie/zmazania hodnôt pri zakliknutí checkboxu pre užívateľa po škole
useEffect(() => {
if (!firstRender) return
if (firstRender.current) return

if (without_school) {
setValue('school', withoutSchoolItem.current)
Expand All @@ -76,7 +76,7 @@ export const SchoolSubForm = ({control, watch, setValue, gap}: SchoolSubFormProp

// predvyplnenie/zmazania hodnôt pri zakliknutí checkboxu pre neznámu školu
useEffect(() => {
if (!firstRender) return
if (firstRender.current) return

if (school_not_found) {
setValue('school', otherSchoolItem.current)
Expand Down

0 comments on commit ac0fc9a

Please sign in to comment.