はじめに
フロントエンドに苦手意識のある私が、@Sicut_studyさんの【Reactアプリ100本ノック】をやってみました。
変なところがあれば教えていただきたいです。
今回の課題
やってみる
App.tsx
import { Box, Button } from "@mui/material";
import { useState } from "react";
const App = () => {
const [count, setcount] = useState(0);
return (
<div>
<Box>{count}</Box>
<Button variant="contained" onClick={()=>setcount(count + 1)}>+</Button>
<Button variant="contained" onClick={()=>setcount(count - 1)}>-</Button>
</div>
);
};
export default App;
完成
おわりに
useState()を使用したことが過去にあったので苦戦しませんでした。次のお題は難しそうですが頑張ります。。