Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

React export stylesheet

$
0
0

I would like to create an external stylesheet using the MaterialUI 'makeStyles' and 'createStyles' like you can in React Native however, I don't know how to do it.

export const useStyles = makeStyles((theme: Theme) =>    createStyles({        root: {            display: 'flex'        },        content: {            flexGrow: 1,            padding: theme.spacing(3),        }    }),);

So this would be called 'globalStyle.tsx' and then in any other file I can import it then do something like styles.root, etc. I've done it before in React Native but as said previously, I'm stuck on how to proceed.

React Native way: https://reactnative.dev/docs/stylesheet


Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>