score:1

would be much easier to have something like:

<button value={stats.player} onclick={() => handleclick(stats.player)}>
   {stats.player}
</button>

...

const handleclick = (player) => {
   setplayer(player);
   loadpeople();
}

in this way you don't need id for button. not only but you will avoid warning on same id for multiple elements.

then i would like to talk about loadpeople(). if i understood correctly in this function you are using player that would be setted by setplayer. this is not a good approach. setplayer is async and you could take an old value of player. much better pass the last player value directly to loadpeople function. something like:

const handleclick = (player) => {
   setplayer(player);
   loadpeople(player);
}

const loadpeople = async (newplayer) => {
   setloading(true);
   const req = await fetch(`/api/player/${newplayer}`);
   const json = await req.json();
   setteams(json);
   setloading(false);
};

Related Query

More Query from same tag