import { PlusCircleFilled } from "@ant-design/icons"; import { Button } from "antd"; import React from "react"; import "./App.less"; function App() { const [coms, setComs] = React.useState([]); const onCreate = () => { setComs([ ...coms, { id: coms.length * Math.random(), text: `New: ${Math.random()}` }, ]); }; const onRemove = (com: any) => { setComs(coms.filter((c: any) => c.id !== com.id)); }; return (
<>Hello World {coms.map((com: any) => (
))}
); } export default App;