React Material UI Button color attribute ternary operator

Viewed 777

I am trying to conditionally render the color of the button based on loader. Not sure what I am doing wrong on the syntax.

<Button type="submit" color={{ loader ? : "primary" : "disabled"}}>
  Join the Waitlist!
</Button>
2 Answers

I had a similar problem gave me fits till i figured out that disabled is not a value in color prop. it is a separate prop with no = attached. use "primary" "secondary" "success" etc. may fix your problem

Related