Skip to content

Commit

Permalink
remove unused file
Browse files Browse the repository at this point in the history
  • Loading branch information
JLarky committed Jun 23, 2023
1 parent b3cec95 commit 76de88c
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions src/components/Counter.tsx
Original file line number Diff line number Diff line change
@@ -1,49 +0,0 @@
import { useRef } from 'react';

import { trpc, TRPCProvider } from './trpc';

export function Counter(props: React.ComponentProps<typeof CounterInteral>) {
return (
<TRPCProvider>
<CounterInteral {...props} />
</TRPCProvider>
);
}

const CounterInteral = ({ counter }: { counter: number }) => {
const incrementMutation = trpc.hello.increment.useMutation();
const keepOld = useRef(counter);
if (incrementMutation.data) {
keepOld.current = incrementMutation.data;
}

return (
<div>
Count: {keepOld.current}
<br />
<button
className="rounded bg-blue-500 px-4 py-2 text-white"
onClick={() => {
incrementMutation.mutate();
}}
>
Increase count
</button>
<details>
<summary>Reveal secret</summary>
If you are a fan of Theo this would probably look crazy to you.
<pre>
{`
// import vercel from '@astrojs/vercel/serverless';
let i = 0;
export const helloRouter = createTRPCRouter({
increment: publicProcedure.mutation(async () => {
return ++i;
}),
});`}
</pre>
</details>
</div>
);
};

1 comment on commit 76de88c

@vercel
Copy link

@vercel vercel bot commented on 76de88c Jun 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.