- Checkout this repository
- Have corepack enabled:
corepack enable yarn installyarn watch- Do your changes (see below)
- Use
yarn generateOverridesto add any new classes also to the Overrides module. - Commit and create a Pull Request
- Take any component from MUI and look for its
d.tsfile, e.g. Accordion.d.ts - Copy the content of the props type over, including the documentation comments.
- Copy also the classes type over, e.g. accordionClasses.ts. This one always must be
type classesas it gets picked up by thegenerateOverridesscript. - Replace all
;with,and adapt the types accordingly. - Cross-check with the corresponding MUI page, e.g. https://mui.com/material-ui/api/accordion/, if you ended up with all the listed props (execept for deprecated ones)
- Have a look at
Accordion.resfor inspiration.
- Every main props type needs to inherit from
CommonProps.t, except if MUI documentation explicitly says that only the listed props are the valid ones. - If some component inherits from a MUI parent, the props to inherit from need to be called publicProps, e.g.
Paper.publicProps. This is necessary, because prop names cannot be overwritten with different types. For instance theclassestype is different betweenAccordionandPaper(of which the former inherits most props).
- For uppercase names, always use @as and write the first letter lowercase
- if there is a conflict, add a
_behind the name - Examples:
InputPropsconflicts withinputPropsso it becomesinputProps_MuiSliderbecomesmuiSlider
- if there is a conflict, add a
- For props that are ReScript keywords, add a
_behind the name- Examples:
typebecomestype_openbecomesopen_
- Examples: