ant-design / ant-design/pro-components

🧐[问题]:使用StepsForm - 分步表单,将每一步封装成一个组件, 传入参数后会将传入组件的参数自动注入到form元素下导致控制台出现报错问题

Open
#8,474 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

### 🧐 问题描述

使用StepsForm - 分步表单,将每一步封装成一个组件, 传入参数后会将传入组件的参数自动注入到form元素下导致控制台出现报错问题

### 💻 示例代码

起初出现的是这样的报错:即将驼峰命名的参数传入会出现这个问题 [React does not recognize the X prop on a DOM element]
将参数全部改为小写后会出现其他的参数传参的问题, 兄弟们有什么好的解决方案吗

### 🚑 其他信息

![image](https://github.com/ant-design/pro-components/assets/74455191/45be3357-5539-461d-8798-b03e48ac2d54)

Contributor guide

Open the contributing guide

Research direction

Start at the StepsForm entry point and reproduce the example described in the issue with a step wrapped as a component and camelCase parameters. Trace which parameters reach the form element; done means component parameters no longer produce React DOM-prop warnings or break parameter passing, and the reported example behaves correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.