fix: add type annotation for data in GitHubStarsButton component

This commit is contained in:
javayhu 2025-06-15 12:24:57 +08:00
parent fd4426ddd7
commit 8a5a49f041

View File

@ -100,7 +100,7 @@ function GitHubStarsButton({
React.useEffect(() => {
fetch(`https://api.github.com/repos/${username}/${repo}`)
.then((response) => response.json())
.then((data) => {
.then((data: any) => {
if (data && typeof data.stargazers_count === 'number') {
setStars(data.stargazers_count);
}