-
Notifications
You must be signed in to change notification settings - Fork 32
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(Forms): console log a warning when Value.SummaryList gets an invalid child #4249
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
3618c4f
to
aa6d2fc
Compare
packages/dnb-eufemia/src/extensions/forms/Value/SummaryList/useVerifyChildren.ts
Show resolved
Hide resolved
} from 'react' | ||
import { warn } from '../../../../shared/helpers' | ||
|
||
export function useVerifyChildren({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When reading verifyChildren.
I immediately think that it verifies children, but what does it mean to verify children?🤔
Some other potential names:
- useVerifyChildrenNotEmpty
- useVerifyChildrenHasElements
- useChildrenNotEmpty
- useVerifyChildrenHasItems
- useVerifyChildrenHasChildren
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more understandable now when we've added a PR description🥳🫡
aa6d2fc
to
f087e63
Compare
## [10.55.1](v10.55.0...v10.55.1) (2024-11-11) ### 🐛 Bug Fixes * **Forms:** console log a warning when Value.SummaryList gets an invalid child ([#4249](#4249)) ([011e9eb](011e9eb)) * **Forms:** ensure Field.Upload handles `required` logic between Wizard step changes ([#4248](#4248)) ([505dbc1](505dbc1))
🎉 This PR is included in version 10.55.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
More info here.
It verifies that only allowed children are passed.
It does this by comparing the amount of given children components vs the amount of the actual wanted components (verified via a context call).⚠️
When there are more other children than the wanted ones, we show a warning
I'm not sure if there are smarter ways to do that. But as of now, I think this may work.