0
点赞
收藏
分享

微信扫一扫

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

M4Y 2022-09-03 阅读 221

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 条评论