@@ -7,8 +7,9 @@ import { capitalize } from '../utils/helpers';
77import { darken , fade , lighten } from '../styles/colorManipulator' ;
88import TableContext from '../Table/TableContext' ;
99import Tablelvl2Context from '../Table/Tablelvl2Context' ;
10+ import muiComponent from '../utils/muiComponent' ;
1011
11- export const styles = theme => ( {
12+ const styles = theme => ( {
1213 /* Styles applied to the root element. */
1314 root : {
1415 ...theme . typography . body2 ,
@@ -99,11 +100,12 @@ export const styles = theme => ({
99100 } ,
100101} ) ;
101102
102- const useStyles = makeStyles ( styles , { name : 'MuiTableCell' } ) ;
103+ const options = { name : 'MuiTableCell' } ;
104+ const useStyles = makeStyles ( styles , options ) ;
103105
104106const TableCell = React . forwardRef ( function TableCell ( props , ref ) {
105107 const {
106- align,
108+ align = 'inherit' ,
107109 children,
108110 classes : classesProp ,
109111 className,
@@ -114,7 +116,7 @@ const TableCell = React.forwardRef(function TableCell(props, ref) {
114116 sortDirection,
115117 variant,
116118 ...other
117- } = useThemeProps ( props , { name : 'MuiTableCell' } ) ;
119+ } = useThemeProps ( props , options ) ;
118120
119121 const classes = useStyles ( props ) ;
120122 const table = React . useContext ( TableContext ) ;
@@ -216,13 +218,10 @@ TableCell.propTypes = {
216218 variant : PropTypes . oneOf ( [ 'head' , 'body' , 'footer' ] ) ,
217219} ;
218220
219- TableCell . defaultProps = {
220- align : 'inherit' ,
221- } ;
222-
223- TableCell . useStyles = useStyles ;
224- TableCell . options = {
225- name : 'MuiTableCell' ,
226- } ;
221+ if ( process . env . NODE_ENV !== 'production' ) {
222+ TableCell . defaultProps = {
223+ align : 'inherit' ,
224+ } ;
225+ }
227226
228- export default TableCell ;
227+ export default muiComponent ( useStyles , TableCell ) ;
0 commit comments