• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / codegate-ui / 13903674755

17 Mar 2025 03:42PM UTC coverage: 61.874% (-4.6%) from 66.452%
13903674755

Pull #345

github

web-flow
Merge ce2550358 into 5d463ef04
Pull Request #345: feat: react-hook-form field array for provider muxes

443 of 798 branches covered (55.51%)

Branch coverage included in aggregate %.

63 of 93 new or added lines in 21 files covered. (67.74%)

50 existing lines in 4 files now uncovered.

904 of 1379 relevant lines covered (65.55%)

36.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/features/workspace/components/tmp/form-reset-on-submit.tsx
1
import { useEffect } from 'react'
2
import { useFormContext } from 'react-hook-form'
3

4
/**
5
 * A component that resets the form after a successful submission.
6
 * Used to test that form fields are reset after a successful submission.
7
 */
8
export function FormResetOnSubmit() {
9
  const {
10
    formState: { isSubmitSuccessful },
11
    reset,
NEW
12
  } = useFormContext()
×
13

14
  // It is recommended in the React Hook Form documentation to use `useEffect` to
15
  // handle side effects like resetting the form after a successful submission.
NEW
16
  useEffect(() => {
×
NEW
17
    if (isSubmitSuccessful) {
×
NEW
18
      reset()
×
19
    }
20
  }, [isSubmitSuccessful, reset])
21

NEW
22
  return null
×
23
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc