-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
feat: support name
prop drilling
#576
feat: support name
prop drilling
#576
Conversation
(cherry picked from commit d94d644)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次更改涉及 Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #576 +/- ##
=======================================
Coverage 88.84% 88.84%
=======================================
Files 6 6
Lines 278 278
Branches 76 76
=======================================
Hits 247 247
Misses 31 31 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- src/AjaxUploader.tsx (2 hunks)
- tests/uploader.spec.tsx (1 hunks)
Additional comments not posted (3)
src/AjaxUploader.tsx (2)
272-272
: 添加name
属性到组件的 props 中代码正确地将
name
属性添加到了组件的 props 中,这允许外部传入name
属性到组件。
311-315
: 在渲染的<input>
元素中包含name
属性代码正确地在
<input>
元素中使用了name
属性。这一修改符合 PR 的目标,即允许name
属性从顶层组件传递到底层的<input>
标签。tests/uploader.spec.tsx (1)
155-159
: 验证name
属性的测试用例此测试用例正确地检查了当
Upload
组件使用name
属性实例化时,相应的输入元素的name
属性也被正确设置为 "bamboo"。这增强了对Upload
组件的测试覆盖率,确保name
属性被正确处理并反映在渲染输出中。
等等,这好像和 #574 是一样的? |
这个逻辑貌似也没错。 |
相比之下就少删除一个默认值 name: 'file', |
yes, 上一个 PR 把 name 透传 + 删除默认值(以为没用到,直接删除了,并且测试用例也没拦截到) 后面发现有问题,就 revert了,并且提了一个 pr 将 name 默认值的测试用例补了一下。 然后再回过头来解决 name 透传问题。 |
将最上游的 name 属性透传给 input 标签。( 不确定是否是最好的结局方案 :(
Summary by CodeRabbit
新功能
AjaxUploader
组件中添加了name
属性,增强了文件输入的功能,便于表单提交和与各种表单处理库的集成。测试
Upload
组件渲染的输入元素的name
属性是否正确设置。