我正在将以下内容用于 <DatePicker>。看了很多视频和沙盒,效果很好。
不知道为什么我在 renderInput 上收到以下错误
<DatePicker
label="Basic example"
value={selectedDate}
onChange={(newValue) => { setSelectedDate(newValue) }}
renderInput={(props) => <TextField {...props} />}
/>
Run Code Online (Sandbox Code Playgroud)
Type '{ label: string; value: Date; onChange: (newValue: Date) => void; renderInput: (props: any) => Element; }' is not assignable to type 'IntrinsicAttributes & DatePickerProps<Date> & RefAttributes<HTMLDivElement>'.
Property 'renderInput' does not exist on type 'IntrinsicAttributes & DatePickerProps<Date> & RefAttributes<HTMLDivElement>'.ts(2322)
Run Code Online (Sandbox Code Playgroud)