Files
aptabase-js/examples/remix-app/app/components/Counter.tsx
Lectom C Han 421105f082
Some checks failed
Release / Release (push) Failing after 1m44s
first commit
2025-07-07 18:53:25 +09:00

26 lines
539 B
TypeScript

import { useAptabase } from '@aptabase/react';
import { useState } from 'react';
export function Counter() {
const { trackEvent } = useAptabase();
const [count, setCount] = useState(0);
function increment() {
setCount((c) => c + 1);
trackEvent('increment');
}
function decrement() {
setCount((c) => c - 1);
trackEvent('decrement');
}
return (
<div>
<p>Count: {count}</p>
<button onClick={increment}>Increment</button>
<button onClick={decrement}>Decrement</button>
</div>
);
}