I have two styles.
One thing is included in specific components, another thing is included in global components.
for example, let's suppose that we have the following tree.
index.tsx
-App.tsx
-globalConstants.ts
in globalConstants.ts
import { Theme, makeStyles, createStyles } from '@material-ui/core/styles';
export const sharedStyles = makeStyles((theme: Theme) =>
createStyles({
.
.
.
}),
);
in App.tsx
import React from 'react';
import { Theme, makeStyles, createStyles } from '@material-ui/core/styles';
import { sharedStyles } from '../constants/globalConstants'
const useStyles = makeStyles((theme: Theme) =>
createStyles({
.
.
.
}),
);
My problem is I can't combine useStyles and sharedStyles into one classes variable.
Of course, I can use this like following
export default function NavBar() {
const classes = useStyles();
const sharedClasses = sharedStyles();
}
But I'd like to combine classes and sharedClasses into one constants such as
const classes = {useStyles()+sharedStyles())
Is there some good way how to combine that?