Skip to content

Commit

Permalink
refactor: use optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Jun 10, 2024
1 parent c4d66c5 commit dc73633
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/core/hooks/useCustomValidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export function useCustomValidity(
customValidity: string | undefined,
): void {
useEffect(() => {
if (ref.current) {
ref.current.setCustomValidity(customValidity || '')
}
ref.current?.setCustomValidity(customValidity || '')
}, [customValidity, ref])
}

0 comments on commit dc73633

Please sign in to comment.