-
-
Notifications
You must be signed in to change notification settings - Fork 590
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: table warning message when columns=[] #966
fix: table warning message when columns=[] #966
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #966 +/- ##
=======================================
Coverage 99.49% 99.49%
=======================================
Files 36 36
Lines 988 989 +1
Branches 319 305 -14
=======================================
+ Hits 983 984 +1
Misses 5 5
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
); | ||
|
||
if (props.columns.length > 0) { | ||
warning( |
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.
为啥不把if的条件放warning的判断参数上?
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.
+1
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.
我来改一下
@@ -701,6 +701,24 @@ describe('Table.Basic', () => { | |||
}); | |||
}); | |||
|
|||
it('without warning - columns is emplty', () => { |
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.
empty
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.
我顺带改一下吧
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.
#972 被大佬抢了
🤔 This is a ...
🔗 Related issue link
fix ant-design/ant-design#41150
💡 Background and solution
Issue: Error message logged on the console when columns is empty []. This issue occurs in the custom body component:
After looking into it, I find that there's no major issue when columns is empty []. So, I just added a conditional check to only log an error if columns.length > 0.
📝 Changelog
☑️ Self-Check before Merge