1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-09-16 20:25:34 -04:00

consistent use of arrow functions/default exports

This commit is contained in:
2022-01-02 15:16:07 -05:00
parent cd5a1b191a
commit ca614e1a1a
34 changed files with 2956 additions and 2985 deletions

View File

@@ -2,7 +2,7 @@ import useSWR from "swr";
import { fetcher } from "../../lib/fetcher";
import Loading from "../loading/Loading";
export default function Hits({ slug }) {
const Hits = ({ slug }) => {
// start fetching repos from API immediately
const { data, error } = useSWR(`/api/hits/?slug=${encodeURIComponent(slug)}`, fetcher, {
// avoid double (or more) counting views
@@ -25,4 +25,6 @@ export default function Hits({ slug }) {
{data.hits.toLocaleString("en-US")}
</span>
);
}
};
export default Hits;