[pickers] slotProps "sx prop does not exist on type" error with custom DatePicker #13171
Labels
component: pickers
This is the name of the generic UI component, not the React module!
customization: css
Design CSS customizability
docs
Improvements or additions to the documentation
Steps to reproduce
https://codesandbox.io/p/sandbox/mui-slotprops-types-8v6mfz?file=%2Fsrc%2FDemo.tsx%3A8%2C1
Steps:
sx
propCurrent behavior
Type errors on
sx
propExpected behavior
sx
prop has types and intellisenseContext
Currently on V6 of
@mui/x-date-pickers
(but issue can be reproduced on latest version of MUI as well) and creating a component wrapping the MUIDatePicker
andDateRangePicker
components.The custom component may have
sx
styles defined internally viaslotProps
but should allow a consumer to override these styles. Thecodesandbox
has a basic example of this but as you can observe, there are type errors on thesx
prop inslotProps
.Your environment
MacOS Sonoma
Chrome Version 125.0.6422.61
Search keywords: sx slotProps typescript DatePicker custom
The text was updated successfully, but these errors were encountered: