Whenever I click the button that routes to different locations via an API, the route works fine but the button color doesn't change on the first click.
To address this issue, I implemented the useState hook and CSS to dynamically change the button color. While it works perfectly, the color change is not reflected immediately upon the first click.