finished react tutorial

This commit is contained in:
Geir Okkenhaug Jerstad 2024-09-19 14:16:59 +02:00
parent b6a60cc2a6
commit 25072921a7
2 changed files with 14 additions and 7 deletions

View file

@ -0,0 +1,11 @@
'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>
}