material-table icon indicating copy to clipboard operation
material-table copied to clipboard

How to use tableRef prop to pass ref over withStyles

Open HanaaAbbas opened this issue 7 years ago • 3 comments

Hi,

I am trying to provide a className to the component to be able to override the CSS of the table component (without using JSS or changing my MaterialUI theme).

In the docs, I found this "tableRef" props but I couldn't find an example of how to use it and what I can benefit from passing this props.

Thanks!

HanaaAbbas avatar May 15 '19 07:05 HanaaAbbas

Which component of MT do you want to apply a style?

mbrn avatar May 16 '19 04:05 mbrn

Is it possible to provide a way to assign className to components like: Toolbar: props => (<MTableToolbar {...props} className="material-table-toolbar" />),

HanaaAbbas avatar May 18 '19 16:05 HanaaAbbas

Is it possible to provide a way to assign className to components like: Toolbar: props => (<MTableToolbar {...props} className="material-table-toolbar" />),

No. But you can use JSS to apply a class.

Check this: https://material-ui.com/customization/css-in-js/

mbrn avatar May 20 '19 04:05 mbrn