Tencent / tdesign-react

A React UI components lib for TDesign.
https://tdesign.tencent.com/react
MIT License
821 stars 318 forks source link

[Form] FormItem期望支持renderProps #1547

Closed yunfeic closed 1 year ago

yunfeic commented 2 years ago

这个功能解决了什么问题

在使用FormItem拦截value, onChange能力时,限定子组件必须有value, onChange,但实际场景存在: 该子组件本身来源于已封装的业务组件,无value, onChange,此时只能再次封装。 若支持renderProps,函数参数中提供value, onChange,不用再次封装自定义组件,更直接方便

你建议的方案是什么

FormItem支持renderProps,参数中提供value, onChange等必要属性方法

github-actions[bot] commented 2 years ago

👋 @yunfeic,感谢给 TDesign 提出了 issue。 请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

github-actions[bot] commented 2 years ago

♥️ 有劳 @ximendatie @cuijinyu @HQ-Lin @BaoTao1997 @yume316 尽快确认问题。 确认有效后将下一步计划和可能需要的时间回复给 @yunfeic 。

honkinglin commented 2 years ago

就算提供了 renderProps也没法更改自定义组件的展示效果吧,最终子组件拿到value onChange的参数要做什么变化还是要内部处理一遍,那跟自己封装一个受控组件没什么区别 你想要的可能是可以自定义 "value" "onChange" 字段?例如有的自定义组件value 是叫 checked,onChange是叫 onChecked 这种?

github-actions[bot] commented 1 year ago

这个 Issue 被标记为了过时 stale ,因为它已经持续 30 天没有任何活动了。删除 stale 标签或评论,否则将在 7 天内关闭。