英文:
how to import multiple makeStyles in tss-react?
问题
Upgrading from MUI4-MUI5 using tss-react
在一些文件中,我们有多个样式导入
const { classes } = GridStyles();
const { classes } = IntakeTableStyles();
const { classes } = CommonThemeStyles();
并且显示错误 'Cannot redeclare block-scoped variable 'classes'',是否有方法导入多个 makeStyles?
尝试导入多个 makeStyles
const { classes } = GridStyles();
const { classes } = IntakeTableStyles();
const { classes } = CommonThemeStyles();
我需要为每个样式命名不同的名称,而不是使用 classes。
英文:
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
得分: 0
const { classes: rfpGridClasses } = RfpGridStyles();
const { classes: intakeTableClasses } = IntakeTableStyles();
const { classes: commonThemeClasses } = CommonThemeStyles();
英文:
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();
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论