1
const styles = {
    bgColor:{
        backgroudColor: '#f9a825'
    }
}

<Button color='primary' classes={fab:classes.bgColor} variant="fab" aria-label="Checkout"> Click Here </Button>

Here, I want to change the background-color. its applying, but it giving priority to Theme css.

1 Answer 1

2
  1. The classes prop is applied incorrectly.
  2. You shouldn't even use classes since you don't seem to inject any; you should use style.
<Button color="primary"
        style={styles.bgColor}
        variant="fab"
        aria-label="Checkout">
    Click Here
</Button>

If you indeed inject classes into you component, you use it like this:

<Button color="primary"
        classes={{ fab: classes.bgColor }}
        variant="fab"
        aria-label="Checkout">
    Click Here
</Button>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.