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: correct validation for children of Box component #2423

Merged
merged 2 commits into from
May 22, 2024

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented May 22, 2024

Fixes a problem where Field was allowed as a child of Box or as the content of a UI by itself. The implementation assumes elsewhere that Field is always a child of Form and so the validation should uphold that.

Note: We should revisit the decision to require Field always being a child of a Form later since it would make sense to allow Box within forms as well for positioning. But this requires a validation refactor.

@FrederikBolding FrederikBolding requested a review from a team as a code owner May 22, 2024 12:11
* This set should include all components, except components that need to be nested
* in another component (e.g. Field must be contained in a Form).
*/
export const BoxChildStruct = nullUnion([
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all of the structs included in JSXElementStruct, excluding FieldStruct

@FrederikBolding
Copy link
Member Author

@metamaskbot update-pr

@FrederikBolding FrederikBolding merged commit a85a943 into main May 22, 2024
151 checks passed
@FrederikBolding FrederikBolding deleted the fb/fix-jsx-root-element-validation branch May 22, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants