#Button onClick

7 messages · Page 1 of 1 (latest)

fallow mortar
#

I'm kind of confused, is this the correct way of using the onClick function?

<Button
                                    color="gray"
                                    disabled={!props.horse.canBeBought}
                                    onClick={() => {
                                        console.log("running button onClick");
                                        onPurchase(props.horse.id, props.horse.price);
                                    }}
                                >
                                    Purchase
                                </Button>
``` ?
#

(the console log doesnt come up when I press the button)

fallow mortar
#

(onMouseOver seems to be triggering)

#

but not onClick

deep sandal
#

This should work. Can you make a sandbox?

agile eagle
#

It will be because the disabled prop is true

fallow mortar
#

sorry guys, I had an external component (called flipping-pages) that fucked up the events somehow