Cleaned up, extracted List to a component

This commit is contained in:
username 2021-02-01 00:10:21 +01:00
parent 76fb43b9d6
commit f45abdecc9
2 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -6,13 +6,13 @@ export default function Workplace() {
const [height, setHeight] = useState("");
const [rectangleArray, setRectangleArray] = useState("");
const numbers = [{ w: "100px", h: "100px", c: "red" }];
numbers.push({ w: "200px", h: "300px", c: "cyan" });
const rectangles = [{ w: "100px", h: "100px", c: "red" }];
rectangles.push({ w: "200px", h: "300px", c: "cyan" });
const handleFormSubmit = (e) => {
e.preventDefault();
numbers.push({ w: width + "px", h: height + "px", c: "blue" });
console.log(numbers);
rectangles.push({ w: width + "px", h: height + "px", c: "blue" });
console.log(rectangles);
};
return (