-
Notifications
You must be signed in to change notification settings - Fork 14
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
merge config prop passed to BentoProvider with the one passed at creation #999
base: main
Are you sure you want to change the base?
Conversation
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
packages/bento-design-system/test/createBentoProvider.test.tsx:5
- [nitpick] Consider renaming the test suite from 'createBentoProviders' to 'createBentoProvider' to match the actual function name and avoid potential confusion.
describe("createBentoProviders", () => {
<DefaultMessagesContext.Provider value={{ defaultMessages }}> | ||
<BentoConfigProvider value={props.config ?? config}> | ||
<DefaultMessagesContext.Provider value={defaultMessagesValue}> | ||
<BentoConfigProvider value={deepmerge(config, props.config) as BentoConfig}> |
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.
I don't know how much overhead deepmerge
adds when one object is undefined
, but since BentoConfigProvider
internally does a deepmerge
too, maybe we can do the merge only if there's a props.config
?
<BentoConfigProvider value={deepmerge(config, props.config) as BentoConfig}> | |
<BentoConfigProvider value={props.config ? deepmerge(config, props.config) as BentoConfig : config}> |
No description provided.