diff --git a/react_test/tutorial/app/like-button.js b/react_test/tutorial/app/like-button.js new file mode 100644 index 0000000..a770e42 --- /dev/null +++ b/react_test/tutorial/app/like-button.js @@ -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 +} \ No newline at end of file diff --git a/react_test/tutorial/app/page.js b/react_test/tutorial/app/page.js index 0370333..0d2935c 100644 --- a/react_test/tutorial/app/page.js +++ b/react_test/tutorial/app/page.js @@ -1,5 +1,4 @@ - -import { useState } from 'react'; +import LikeButton from "./like-button"; function Header({ title }) { return