const [items, setItems] = React.useState();
import React, { useState } from "react";
const MemoID = ({ getID }) => {
return Array.from(new Array(getID)).map((_, i) => {
return <p key={i}> {i} </p>;
});
};
export default function App() {
let [getID, setID] = useState(0);
return (
<>
<MemoID key={getID} {...{ getID }} />
<button onClick={() => setID(getID + 1)}> clickMe </button>
</>
);
}