React to decide button being clicked