how to import multiple makeStyles in tss-react?

100 Views Asked by At

Upgrading from MUI4-MUI5 using tss-react in some files we have multiple styles import

 const { classes } = GridStyles();
 const { classes } = IntakeTableStyles();
 const { classes } = CommonThemeStyles();

and it shows 'Cannot redeclare block-scoped variable 'classes'' error is there any way to import multiple makeStyles?

Trying to import multiple makeStyles

 const { classes } = GridStyles();
 const { classes } = IntakeTableStyles();
 const { classes } = CommonThemeStyles();

i need to name each styles with different name instead of classes

1

There are 1 best solutions below

1
On BEST ANSWER

Assigning to new variable names

A property can be unpacked from an object and assigned to a variable with a different name than the object property.

 const { classes: rfpGridClasses } = RfpGridStyles();
 const { classes: intakeTableClasses } = IntakeTableStyles();
 const { classes: commonThemeClasses } = CommonThemeStyles();