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;

浙公网安备 33010602011771号