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: add default value on nested inputs to avoid console errors #974

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

letsbelopez
Copy link
Contributor

@letsbelopez letsbelopez commented Apr 3, 2023

Problem

Nested inputs have an initial value that is undefined. This causes console errors "uncontrolled to controlled component"

Solution

Add a fallback defined value if it's a nested form field.

Additional Notes

Links

Ticket

GitHub issue _____

aws-amplify/amplify-studio#817

Other links

Verification

Manual tests

Automated tests

  • Unit tests added/updated
  • E2E tests added/updated
  • N/A - (provide a reason)
  • deferred - (provide GitHub issue for tracking)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@letsbelopez letsbelopez requested a review from a team as a code owner April 3, 2023 22:39
@codecov-commenter
Copy link

Codecov Report

Merging #974 (e9e5756) into main (cb4dba4) will not change coverage.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #974   +/-   ##
=======================================
  Coverage   93.02%   93.02%           
=======================================
  Files         120      120           
  Lines        5293     5293           
  Branches     1578     1578           
=======================================
  Hits         4924     4924           
  Misses        348      348           
  Partials       21       21           
Impacted Files Coverage Δ
...eact/lib/forms/form-renderer-helper/value-props.ts 97.29% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb4dba4...e9e5756. Read the comment docs.

@letsbelopez letsbelopez merged commit 7299042 into main Apr 4, 2023
@letsbelopez letsbelopez deleted the nested-initial-values branch April 4, 2023 22:06
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.

None yet

4 participants