MetaMask / snaps

Extend the functionality of MetaMask using Snaps
https://metamask.io/snaps/
Other
724 stars 557 forks source link

feat: support additional components inside forms #2497

Closed FrederikBolding closed 3 months ago

FrederikBolding commented 3 months ago

Adds support for additional components inside forms, essentially allowing all children of Box to also be children of Form. Although Form remains the only component where Field can exist. This also means forms can now be nested, when this happens the input state is tied to the nearest parent form.

To support this change, a refactor of the constructState function was done. This function now uses walkJsx to walk the entire JSX tree and collect state values.

Closes https://github.com/MetaMask/snaps/issues/2496

FrederikBolding commented 3 months ago

@metamaskbot update-pr

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.36%. Comparing base (a435bff) to head (6d4c157).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2497 +/- ## ======================================= Coverage 94.35% 94.36% ======================================= Files 441 441 Lines 9076 9068 -8 Branches 1398 1396 -2 ======================================= - Hits 8564 8557 -7 + Misses 512 511 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.