Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): remove strict mode, temporarily #7755

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

KenLSM
Copy link
Contributor

@KenLSM KenLSM commented Oct 7, 2024

Problem

Due to useEffect calling twice. This is as intended by the React Core team to help discover potential useEffect bugs on our system where we're not properly handling unsubscribes.

Potential workaround is to remove <React.StrictMode> from root. However, this is not recommended to be a permanent fixture.

References FRM-1871

Solution

Breaking Changes

  • No - this PR is backwards compatible

Tests

react-hook-form submit should display errors on local development

  • Create a storage mdoe form
  • Add short field
  • Open form
  • Hit the submit button
  • Observe that the error appears immediately

Copy link

linear bot commented Oct 7, 2024

@kevin9foong
Copy link
Contributor

kevin9foong commented Oct 8, 2024

Trying to debug this issue as well

Some observations/clues which might be useful:

  • For nric field, does not seem to re-render when onBlur or onSubmit. For radio buttons though, it does re-render.
  • printing the error object from useFormState, it is an empty object despite validation failure.

@KenLSM KenLSM merged commit bc199c8 into develop Oct 9, 2024
26 checks passed
@KenLSM KenLSM deleted the fix/temporary-removal-strict-mode branch October 9, 2024 02:45
@KenLSM KenLSM mentioned this pull request Oct 14, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants