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

Change types to allow regular array types as children #2470

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Jun 7, 2024

In #2466 we changed the types and validation of JSX components to use NonEmptyArray<Type> as children. This causes issues however when using utility functions like .map() and .filter(), since they return a regular Type[] type. This is not great for devex, since it would require type assertions everywhere.

I've changed the types to accept Type[], though we technically still validate NonEmptyArray<Type>.

@Mrtenz Mrtenz requested a review from a team as a code owner June 7, 2024 10:53
FrederikBolding
FrederikBolding previously approved these changes Jun 7, 2024
@Mrtenz Mrtenz merged commit 4c8ee13 into main Jun 7, 2024
151 checks passed
@Mrtenz Mrtenz deleted the mrtenz/non-empty-children-validation branch June 7, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants