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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user