-
Notifications
You must be signed in to change notification settings - Fork 199
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: 修复默认配置对 ChartSheet 不生效 #3075
Conversation
你好 @lijinke666,非常感谢你的贡献. Hello, @lijinke666, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the docs if there are API changes. |
Walkthrough此PR修复了默认配置对ChartSheet不生效的问题。通过重构代码,确保自定义选项与默认选项和主题配置合并,解决了配置不生效的问题。 Changes
|
customOptions, | ||
options, | ||
); | ||
}, [customOptions]); |
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.
The merging logic for options
now includes defaultOptions
, customOptions
, and options
. Ensure that the order of merging is correct to avoid unintended overwrites.
@@ -39,11 +27,27 @@ export const ChartSheet: React.FC<SheetComponentProps> = React.memo((props) => { | |||
}, | |||
}; | |||
|
|||
return customMerge<SheetComponentOptions>(defaultOptions, options); | |||
}, [defaultOptions]); | |||
const options: SheetComponentOptions = { |
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.
调整 merge 顺序, 确保自定义的 style
可以被覆盖
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3075 +/- ##
==========================================
Coverage 75.77% 75.77%
==========================================
Files 257 51 -206
Lines 11994 1490 -10504
Branches 2464 284 -2180
==========================================
- Hits 9088 1129 -7959
+ Misses 1398 210 -1188
+ Partials 1508 151 -1357 ☔ View full report in Codecov by Sentry. |
Size Change: +22 B (0%) Total Size: 619 kB
ℹ️ View Unchanged
|
👀 PR includes
🐛 Bugfix
📝 Description
🖼️ Screenshot
🔗 Related issue link
🔍 Self-Check before the merge