mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
20 lines
363 B
TypeScript
20 lines
363 B
TypeScript
'use client'
|
|
|
|
import { useCallback } from 'react'
|
|
|
|
const Button = ({ message }: { message: string }) => {
|
|
const handleClick = useCallback(() => {
|
|
throw new Error(message)
|
|
}, [message])
|
|
|
|
return (
|
|
<button type="button" onClick={handleClick}>
|
|
Click me
|
|
</button>
|
|
)
|
|
}
|
|
|
|
export default function Page() {
|
|
return <Button message="Kaputt!" />
|
|
}
|