react18-学习笔记24-在函数组件-state-hook

M4Y

关注

阅读 223

2022-09-03

react18-学习笔记24-在函数组件-state-hook_--

import React, { useState } from "react";
interface IHelloProps {
message?: string;
}
const LikeButton:React.FC = () => {
const [like, setLike] = useState(0);
return (
<div>
<div>111</div>
<button onClick={()=>{setLike(like+1)}}>111</button>
</div>
)
};

export default LikeButton;



相关推荐

精彩评论(0)

0 0 举报