0

For example, if you create a makeStyles variable for a component (e.g. TableRow) and that component is called multiple times by a parent component (Table), each TableRow gets class names like “.mui-make-styles-column244” and “.mui-make-styles-column331”.

Is there a reason for this?

Can't tell if this number scheme is an optimization or if it indicates that I should be optimizing how I organize my styles.

NearHuscarl
  • 66,950
  • 18
  • 261
  • 230
Hsin Tung
  • 9
  • 2
  • If you are getting more than one class name for the same call to `makeStyles` then you are most likely using it incorrectly. Please post an example of your code where you see this behavior -- preferably along with a [code sandbox](https://codesandbox.io/s/new) reproducing the behavior. – Ryan Cogswell Oct 14 '21 at 21:06
  • 1
    @RyanCogswell Actually in the process of making the code sandbox, I realized my issue. I was calling makeStyles in each row component rather than calling it once. Once I refactored this, performance improved significantly. Thanks a lot! – Hsin Tung Oct 18 '21 at 01:34

0 Answers0