-
-
Notifications
You must be signed in to change notification settings - Fork 50.1k
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: fix error when component === false #45671
Conversation
Run & review this pull request in StackBlitz Codeflow. |
size-limit report 📦
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #45671 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 699 699
Lines 11815 11816 +1
Branches 3150 3151 +1
=========================================
+ Hits 11815 11816 +1
☔ View full report in Codecov by Sentry. |
奇怪,这个如果传了 false 有报错吗 https://github.com/react-component/field-form/blob/master/src/Form.tsx |
没懂,这里传了 false 只是隐藏了dom,跟 rc-form 有啥关系吗? |
rc-form 看起来也有这个问题 |
如果 rc-form 没有这个问题,那就是 React.Fragment 这个去掉,就是不用判断 false,应该就能解决这个 issue 的问题 |
这里有三个节点,React.Fragment 没办法去掉,就算不判断 false,也得加一个 <></> |
那就加 |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
component={false}
to App show invalid prop warning #45670💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at f8cb9e6
This pull request improves the test coverage and robustness of the app component. It adds a new test case for when the
appConfig
prop is false, and modifies thecomponents/app/index.tsx
file to handle this scenario correctly.🔍 Walkthrough
🤖 Generated by Copilot at f8cb9e6
components/app/__tests__/index.test.tsx
(link, link, link)