Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import React from 'react'
  2. import Button from '@material-ui/core/Button'
  3. import { createMuiTheme } from '@material-ui/core/styles'
  4. import { withStyles } from '@material-ui/styles'
  5.  
  6. const styles = (theme) => {
  7. // here i'm getting myTheme with red palette.primary.main
  8. console.log(theme)
  9. return {}
  10. }
  11.  
  12. export const MyButton = (props) => <Button {...props}/>
  13.  
  14. // reset primary color to red, so MyButton primary will be always red.
  15. const myTheme = createMuiTheme({
  16. palette: {
  17. primary: {
  18. main: '#ff0000',
  19. }
  20. }
  21. })
  22.  
  23. export default withStyles(styles, {defaultTheme: myTheme})(MyButton)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement