11 lines
262 B
JavaScript
11 lines
262 B
JavaScript
|
'use client';
|
||
|
|
||
|
import { useState } from 'react';
|
||
|
|
||
|
export default function LikeButton() {
|
||
|
const [likes, setLikes] = useState(0);
|
||
|
function handleClick(){
|
||
|
setLikes(likes + 1);
|
||
|
}
|
||
|
return <button onClick={handleClick}>Likes ({likes})</button>
|
||
|
}
|