import * as React from 'react';
import FormHelperText from '@mui/material/FormHelperText';
import FormControl from '@mui/material/FormControl';
import { createTheme } from '@mui/material/styles';
declare module '@mui/material/FormHelperText' {
interface FormHelperTextPropsVariantOverrides {
warning: true;
}
}
// theme typings should work as expected
const theme = createTheme({
components: {
MuiFormHelperText: {
variants: [
{
props: { variant: 'warning' },
style: {
backgroundColor: '#ffa726',
color: '#ffffff',
},
},
],
},
},
});
This is warning helper text
;
{/* @ts-expect-error unknown variant */}
This is example helper text
;