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>
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>
color is waiting for a string not an object.
color={loader ? "primary" : "disabled"}
see the examples here: https://material-ui.com/components/buttons/#button
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