React – Material-UI版本6,DesktopDatePicker中不可用renderInput属性

huangapple go评论77阅读模式
英文:

React - Material-UI version 6, renderInput Property not available in DesktopDatePicker

问题

如在标题中提到,使用React与Material UI版本6库,我想自定义渲染的输入。在版本5中,DateTimePicker有一个名为"inputProp"的属性,在版本6中不再可用,我找不到任何关于它的重命名或其他信息。

英文:

As mentioned in the header,
using React with the Material UI Version.6 Llibrary,

I want to customize the rendered Input.

In Version.5 there is the property "inputProp" of DateTimePicker,
in Version.6 it is not available anymore and i cannot find any renaming or anything about it in the Docs.

答案1

得分: 0

你必须使用 slotsslotProps

https://stackblitz.com/edit/react-wafgu1?file=src%2FMobileDatePickerWithCalendarIcon.js

请查看此示例。

英文:

You have to use slots and slotProps.

https://stackblitz.com/edit/react-wafgu1?file=src%2FMobileDatePickerWithCalendarIcon.js

Please check this example.

huangapple
  • 本文由 发表于 2023年3月31日 19:15:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/75897907.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定