From a9d831d1af8d98bca582ee8925843f7e16131bde Mon Sep 17 00:00:00 2001 From: Philippe Torrel Date: Thu, 13 Aug 2026 08:39:03 +0200 Subject: [PATCH] --- .../02_react-api-with-hooks/package-lock.json | 500 +++++++++++++++--- .../02_react-api-with-hooks/package.json | 11 +- .../tag43/02_react-api-with-hooks/src/App.jsx | 22 + .../examples/ExampleUseEffectDidUpdate.jsx | 32 ++ .../examples/ExampleUseEffectMount.jsx | 28 + .../examples/ExampleUseEffectUnMount.jsx | 35 ++ .../src/components/lists/ListTodo.jsx | 32 ++ .../src/components/lists/ListUser.jsx | 42 ++ 8 files changed, 613 insertions(+), 89 deletions(-) create mode 100644 05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectDidUpdate.jsx create mode 100644 05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectMount.jsx create mode 100644 05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectUnMount.jsx create mode 100644 05_react/unterricht/tag43/02_react-api-with-hooks/src/components/lists/ListTodo.jsx create mode 100644 05_react/unterricht/tag43/02_react-api-with-hooks/src/components/lists/ListUser.jsx diff --git a/05_react/unterricht/tag43/02_react-api-with-hooks/package-lock.json b/05_react/unterricht/tag43/02_react-api-with-hooks/package-lock.json index ce8117d..9135da4 100644 --- a/05_react/unterricht/tag43/02_react-api-with-hooks/package-lock.json +++ b/05_react/unterricht/tag43/02_react-api-with-hooks/package-lock.json @@ -8,17 +8,18 @@ "name": "01_components-with-hooks", "version": "0.0.0", "dependencies": { + "axios": "^1.19.0", "react": "^19.2.8", "react-dom": "^19.2.8", "react-icons": "^5.7.0" }, "devDependencies": { - "@types/react": "^19.2.17", - "@types/react-dom": "^19.2.3", - "@vitejs/plugin-react": "^6.0.4", - "oxlint": "^1.75.0", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.4", + "@vitejs/plugin-react": "^6.0.5", + "oxlint": "^1.78.0", "sass-embedded": "^1.100.0", - "vite": "^8.2.0" + "vite": "^8.2.1" } }, "node_modules/@bufbuild/protobuf": { @@ -39,9 +40,9 @@ } }, "node_modules/@oxlint/binding-android-arm-eabi": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.77.0.tgz", - "integrity": "sha512-E06sKWS6PiI6HRxS1wyQg22HvApt01hI7fV+T3wUk3OSbaaP4a3hYGY/MIQDmASqCiRjBdpRQYkgMkqH82cWmQ==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.78.0.tgz", + "integrity": "sha512-Bu819lmAfZMUHErrpe0cEWj3iaefuUODHSU8+UbXy67V/r7/7f4K3FL0NmbD85E+wiFLDYuhP8Zlv0XnVeXshw==", "cpu": [ "arm" ], @@ -56,9 +57,9 @@ } }, "node_modules/@oxlint/binding-android-arm64": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.77.0.tgz", - "integrity": "sha512-NvsKz0KZxTp9cYWPLf+FXaSZwB3oO3peAjtukpOMBgse2vhQSoIIVqeO1yR0lEo/UcdZIDL18uq+kL0LzQ0ytA==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.78.0.tgz", + "integrity": "sha512-CDfxZgB61B7buRdY2FJoAYYPPXCZ1EoC1LKscnC5dg3kjobdxiconvAvvN1BmHyW4PyFT3jRLDag/BY/roSNBQ==", "cpu": [ "arm64" ], @@ -73,9 +74,9 @@ } }, "node_modules/@oxlint/binding-darwin-arm64": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.77.0.tgz", - "integrity": "sha512-bgjTn6nW4bQCFBvSvuHCpDD+sONvmpo4lGI4PxzMt1quBA+xYxhczk6RiCn3GZ9gY8uhaBbwhj9MdKGfu6T9DA==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.78.0.tgz", + "integrity": "sha512-2Y2U9Ahrz+OO0Ej88f9SJYq51/jUBp1Mc7iZu0ukrbeeZ3gpRGfzIFnoqfHDY96xr0GEfNrPUBFEy0nN5aD7HA==", "cpu": [ "arm64" ], @@ -90,9 +91,9 @@ } }, "node_modules/@oxlint/binding-darwin-x64": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.77.0.tgz", - "integrity": "sha512-aotaIttH1R6j1Rwhx0M0htgeZyGtVQqYNTVEYMN/UcgHPquGA6kmk9OyuDc3a2GKUQBC+3C3GVQCcrRPMYqAFA==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.78.0.tgz", + "integrity": "sha512-rpych6eJq6m9jDRypTEaPD1xysaEW5h9+xuxhGK/QhOg+/xaqPZrCrTNoIl/f3nEjuJeCEmstNDlrE9rJi/3/g==", "cpu": [ "x64" ], @@ -107,9 +108,9 @@ } }, "node_modules/@oxlint/binding-freebsd-x64": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.77.0.tgz", - "integrity": "sha512-nNx/wta7ksRAdYvq+l4AWjXkLxEXHALhENxjj2cYbQAIR4ybaA5L+hCbE63HOmft5czQ6ks+hb8vmEAnn7YGPg==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.78.0.tgz", + "integrity": "sha512-IcMGrQT3QizkOESUJd5et+rOhVqSkNDfNik1cvrKDqIbzqx9KMtRswpFgkCuNTSwylCFLKhGUu8KmqY1ZnC0Dg==", "cpu": [ "x64" ], @@ -124,9 +125,9 @@ } }, "node_modules/@oxlint/binding-linux-arm-gnueabihf": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.77.0.tgz", - "integrity": "sha512-tMLLjM7xXtzXisVCzkOTXNCy9bZVId2wteNwjohlFDR/jY6WagpEDA1c1wu4xRc20Hojaxj+V6DSR7gbKxijWA==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.78.0.tgz", + "integrity": "sha512-/uLdoJ0IXE6vo/0f0LKjinQAp+re+VMaCWaNT8ENIv2EOCkSsc8SGaflXAuW0Jua2dq5+GLVWm1NQK7P3UFSNQ==", "cpu": [ "arm" ], @@ -141,9 +142,9 @@ } }, "node_modules/@oxlint/binding-linux-arm-musleabihf": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.77.0.tgz", - "integrity": "sha512-MiAFDFaqR0tmHTAyo0YDcZ5hyLREdYw/RQhc2R3cbT+8O3tB+zqPM2th9TTQ+Uo3jn/embS+DO+HyX9ztCPkOQ==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.78.0.tgz", + "integrity": "sha512-7xi4Wb/O8NRJhLoUXmDJMUVpNYvB5kefdhFU1Jb8rtae4QoXlTiLwI14X4YvAXVZLNZChP8m5qO9SQAlWQTbkQ==", "cpu": [ "arm" ], @@ -158,9 +159,9 @@ } }, "node_modules/@oxlint/binding-linux-arm64-gnu": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.77.0.tgz", - "integrity": "sha512-/xqQ3B16i1T4cyt/9Mn+4CpzhUXoBXp7kVpIwzOXNFLj5JmK1bIjsbSnX296Gg8A/o7oDtKWikFgBx0SLwztkw==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.78.0.tgz", + "integrity": "sha512-4hFW0+fVXa3OIh1Y4A5SPkmvI4wuuBSrCVKzOyE7PTjhc7yEqZ1pmvEEeS5Lj/MaqvegFxXyF33N+6jkehxdyg==", "cpu": [ "arm64" ], @@ -178,9 +179,9 @@ } }, "node_modules/@oxlint/binding-linux-arm64-musl": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.77.0.tgz", - "integrity": "sha512-LSbwuRKiNCenPDcbARqAZ5RfBy7gmj7vOvfJRLeCDU3gFtSxWbhv/+VTlaUqzUhNj1gFLHB8h7ALnxa/Az6z6g==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.78.0.tgz", + "integrity": "sha512-oC0mvsgBJjlMijSDEhx9KuvR9zYeHXceA9MjbuXB1F8NSR78Yj2unOBrstEvTVaq+pko+kuue6DajC00eqvTdg==", "cpu": [ "arm64" ], @@ -198,9 +199,9 @@ } }, "node_modules/@oxlint/binding-linux-ppc64-gnu": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.77.0.tgz", - "integrity": "sha512-QWdcH31mXEUe5Nq1s0CfCpceaKjIo9uZtwDjAuL681g1axf+5x8xrg/eXWaw//4NCxYZ4V4e5Hu5tvdR+pTBlg==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.78.0.tgz", + "integrity": "sha512-XAllT5SUZS+ohjuZ3/5S0cwe0r7eboiuigeStCZ5DXRYx/2KVM2UvQXvAfyzXEimtQjAB7cDQ2YxDe2Zl2WNQQ==", "cpu": [ "ppc64" ], @@ -218,9 +219,9 @@ } }, "node_modules/@oxlint/binding-linux-riscv64-gnu": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.77.0.tgz", - "integrity": "sha512-GnOfYgJxbcElOiPZaDFDl406ONddwvOWk2jvAAAEjwAl4GofNoHF+/HHUIBYa6bFCArlcGPi0XjC4cU1pkgF/Q==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.78.0.tgz", + "integrity": "sha512-trucMER/0QtecoXvc1y/UVqE3kwJipDwrx4oHfj+nNm3dq2zjP44WT0CfHNDPM3G1DXIkx/gY6lAD21NSCZVhA==", "cpu": [ "riscv64" ], @@ -238,9 +239,9 @@ } }, "node_modules/@oxlint/binding-linux-riscv64-musl": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.77.0.tgz", - "integrity": "sha512-AyEMTUCf0xY+hHF+IxqXFQIX0yQOIR8ykpY0lJNOw9xYqOzUX8dyZfRvlG0RfXwuQn2eonf/8NrMmDSZJjdqsA==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.78.0.tgz", + "integrity": "sha512-cm3O4F/HQbdzOUX5mKHqG5KDL6E5w0pnlZ+fbBy2rmLryPOowkuLagFHTopQsEIpjcaZoPOrL+BmmAytAG9HFg==", "cpu": [ "riscv64" ], @@ -258,9 +259,9 @@ } }, "node_modules/@oxlint/binding-linux-s390x-gnu": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.77.0.tgz", - "integrity": "sha512-sPLzEcNvxd/oyVQ5oZo92CiHkFkpBeRop13E/P3TPY+hZfXHKCOWKI70TE2RYwMKFJDc20EMjH16L7NZICtKTw==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.78.0.tgz", + "integrity": "sha512-33wRf6HqGNsybJ3qX4cGaQN2ODPxNmc1rMa0mrTmx3eFq1VzOnvQooi9bIGVYakW8a/wmqVx1mgsUm8R2xfTiw==", "cpu": [ "s390x" ], @@ -278,9 +279,9 @@ } }, "node_modules/@oxlint/binding-linux-x64-gnu": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.77.0.tgz", - "integrity": "sha512-1Oh2ssH2L7lwyvkdSqaMUfsGfwU2Wfvew+obBUYjRVqhpBcUpwnsPSEr1IzVi9XqkuY10geiLsNKecqaZC34Dw==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.78.0.tgz", + "integrity": "sha512-rRdISSYegj6VganMZ9tjRjijowfHJ09IZU01i0toBAqr6n5LEtwHq2IeS4FjW2RoskOHlb6efB26H5izYb3GEQ==", "cpu": [ "x64" ], @@ -298,9 +299,9 @@ } }, "node_modules/@oxlint/binding-linux-x64-musl": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.77.0.tgz", - "integrity": "sha512-0j/2wRgNGO+Qj/M1uu/p57h/hFTTWWcfie0ufkbabeus2s5+/QqkCflnMOwLLN5m2GsNeWp4xdl4cPa4n7QCOQ==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.78.0.tgz", + "integrity": "sha512-GmsP4rW0xTL6u5CVdcDsaN5Fbc7hBc382Wmar1kttbnwSEviM+rSINKOMQ+UQ6iH+AGwC+8gaAiwu134Tgh6Lg==", "cpu": [ "x64" ], @@ -318,9 +319,9 @@ } }, "node_modules/@oxlint/binding-openharmony-arm64": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.77.0.tgz", - "integrity": "sha512-BJ/j54qS0usEnyDkLYURMj2iiD9h5Cyy+ppzeMSXBGRXaGRNWnj1Mw14NqWMR5E/PzdgB30OOCCzLzbRoduafw==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.78.0.tgz", + "integrity": "sha512-sy9yeYuADc8a+n4TLBayzMCZiHPW78DcIFVpOXTmdKHWQeM9xe5uzkqIIZmi326D5hY9XVwacipEB1p7tQjPAg==", "cpu": [ "arm64" ], @@ -335,9 +336,9 @@ } }, "node_modules/@oxlint/binding-win32-arm64-msvc": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.77.0.tgz", - "integrity": "sha512-Yh8w+g2Lpx7StrvtYkoz9JJvXjB9wxgFChFNb85nrXm/wj/XTwGWS1hve9+900HL7llrntYB3YP+y32E3tRqzA==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.78.0.tgz", + "integrity": "sha512-rjc2hF1KfMi8fZj1X/m3AmnHbdsF3rL0v6KQg0Uc880Yb2khjz+3U14sfdZ7jWTpRnN1m1NQa/TT7uU9lJWPrA==", "cpu": [ "arm64" ], @@ -352,9 +353,9 @@ } }, "node_modules/@oxlint/binding-win32-ia32-msvc": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.77.0.tgz", - "integrity": "sha512-zja5b7+6a7UsRFgAQSrnax5vrzliEyNPLCjfXONu/vTWswaIVZGFajJZptaeRvPE4LghtFdAzVFlexTm7MVTGA==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.78.0.tgz", + "integrity": "sha512-zcuXFVrEFHIafRfkCQT8w/Xe41o07ozl/vwHq7p94vB29xVzsB0sZGYORU1jhcYKv3Lr0J3HbJ2T4fHH5rWmvA==", "cpu": [ "ia32" ], @@ -369,9 +370,9 @@ } }, "node_modules/@oxlint/binding-win32-x64-msvc": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.77.0.tgz", - "integrity": "sha512-+teyvPDZ2RjUvo+SuCqS/UhaJl1QtdW5fWT5NJTV61V5MIuIS90Db9LixmtEGvXixyttiK62P96MSu3UlpviBw==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.78.0.tgz", + "integrity": "sha512-Sb5ocmLSuYeOuXd+CFOToGKp/gjXUEWDnvIGwhnh8aq8wY4TMmEnKnvbogSW7RdMZv77JSARduS7/gv+khYEjA==", "cpu": [ "x64" ], @@ -1000,6 +1001,49 @@ } } }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.19.0.tgz", + "integrity": "sha512-ht/iuYZXEjFxLH/Hkezgd7m6JKlHHXEUSneaDz8uZe1Gj5QZtCnpyDsckvAiEnT89OEbCLmnte4R4sn7P0EKFw==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.6", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/chokidar": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", @@ -1024,6 +1068,18 @@ "dev": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", @@ -1031,6 +1087,32 @@ "dev": true, "license": "MIT" }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -1041,6 +1123,65 @@ "node": ">=8" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -1059,6 +1200,42 @@ } } }, + "node_modules/follow-redirects": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1074,6 +1251,64 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1084,6 +1319,58 @@ "node": ">=8" } }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/immutable": { "version": "5.1.9", "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.9.tgz", @@ -1389,6 +1676,42 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, "node_modules/nanoid": { "version": "3.3.17", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.17.tgz", @@ -1417,9 +1740,9 @@ "optional": true }, "node_modules/oxlint": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.77.0.tgz", - "integrity": "sha512-qnGh8XJHaQ0dprrDXNQZgS0FgjI6v+V3+X8DwmaV++5Aamy6jGKfDdQ1TUvhUxtmKFAbEf4/WeO5QZX+5WSngg==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.78.0.tgz", + "integrity": "sha512-QgQePuxIqKOzo1KSjG2EnITEeWvWnKAm77eq8nrMtf6AGoA+zyGc4PFYtDNJSD25g/ibOwfQ851hZ4/SPkMVoA==", "dev": true, "license": "MIT", "bin": { @@ -1432,25 +1755,25 @@ "url": "https://github.com/sponsors/Boshen" }, "optionalDependencies": { - "@oxlint/binding-android-arm-eabi": "1.77.0", - "@oxlint/binding-android-arm64": "1.77.0", - "@oxlint/binding-darwin-arm64": "1.77.0", - "@oxlint/binding-darwin-x64": "1.77.0", - "@oxlint/binding-freebsd-x64": "1.77.0", - "@oxlint/binding-linux-arm-gnueabihf": "1.77.0", - "@oxlint/binding-linux-arm-musleabihf": "1.77.0", - "@oxlint/binding-linux-arm64-gnu": "1.77.0", - "@oxlint/binding-linux-arm64-musl": "1.77.0", - "@oxlint/binding-linux-ppc64-gnu": "1.77.0", - "@oxlint/binding-linux-riscv64-gnu": "1.77.0", - "@oxlint/binding-linux-riscv64-musl": "1.77.0", - "@oxlint/binding-linux-s390x-gnu": "1.77.0", - "@oxlint/binding-linux-x64-gnu": "1.77.0", - "@oxlint/binding-linux-x64-musl": "1.77.0", - "@oxlint/binding-openharmony-arm64": "1.77.0", - "@oxlint/binding-win32-arm64-msvc": "1.77.0", - "@oxlint/binding-win32-ia32-msvc": "1.77.0", - "@oxlint/binding-win32-x64-msvc": "1.77.0" + "@oxlint/binding-android-arm-eabi": "1.78.0", + "@oxlint/binding-android-arm64": "1.78.0", + "@oxlint/binding-darwin-arm64": "1.78.0", + "@oxlint/binding-darwin-x64": "1.78.0", + "@oxlint/binding-freebsd-x64": "1.78.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.78.0", + "@oxlint/binding-linux-arm-musleabihf": "1.78.0", + "@oxlint/binding-linux-arm64-gnu": "1.78.0", + "@oxlint/binding-linux-arm64-musl": "1.78.0", + "@oxlint/binding-linux-ppc64-gnu": "1.78.0", + "@oxlint/binding-linux-riscv64-gnu": "1.78.0", + "@oxlint/binding-linux-riscv64-musl": "1.78.0", + "@oxlint/binding-linux-s390x-gnu": "1.78.0", + "@oxlint/binding-linux-x64-gnu": "1.78.0", + "@oxlint/binding-linux-x64-musl": "1.78.0", + "@oxlint/binding-openharmony-arm64": "1.78.0", + "@oxlint/binding-win32-arm64-msvc": "1.78.0", + "@oxlint/binding-win32-ia32-msvc": "1.78.0", + "@oxlint/binding-win32-x64-msvc": "1.78.0" }, "peerDependencies": { "oxlint-tsgolint": ">=7.0.2001", @@ -1514,6 +1837,15 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/react": { "version": "19.2.8", "resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz", diff --git a/05_react/unterricht/tag43/02_react-api-with-hooks/package.json b/05_react/unterricht/tag43/02_react-api-with-hooks/package.json index bbae0a6..158d7af 100644 --- a/05_react/unterricht/tag43/02_react-api-with-hooks/package.json +++ b/05_react/unterricht/tag43/02_react-api-with-hooks/package.json @@ -10,16 +10,17 @@ "preview": "vite preview" }, "dependencies": { + "axios": "^1.19.0", "react": "^19.2.8", "react-dom": "^19.2.8", "react-icons": "^5.7.0" }, "devDependencies": { - "@types/react": "^19.2.17", - "@types/react-dom": "^19.2.3", - "@vitejs/plugin-react": "^6.0.4", - "oxlint": "^1.75.0", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.4", + "@vitejs/plugin-react": "^6.0.5", + "oxlint": "^1.78.0", "sass-embedded": "^1.100.0", - "vite": "^8.2.0" + "vite": "^8.2.1" } } diff --git a/05_react/unterricht/tag43/02_react-api-with-hooks/src/App.jsx b/05_react/unterricht/tag43/02_react-api-with-hooks/src/App.jsx index 0e8b010..902b6f7 100644 --- a/05_react/unterricht/tag43/02_react-api-with-hooks/src/App.jsx +++ b/05_react/unterricht/tag43/02_react-api-with-hooks/src/App.jsx @@ -5,11 +5,16 @@ // import FormNewsletter from './components/forms/FormNewsletter'; import ExampleUseContext from './components/examples/ExampleUseContext'; +import ExampleUseEffectDidUpdate from './components/examples/ExampleUseEffectDidUpdate'; +import ExampleUseEffectMount from './components/examples/ExampleUseEffectMount'; +import ExampleUseEffectUnMount from './components/examples/ExampleUseEffectUnMount'; import ExampleUseId from './components/examples/ExampleUseId'; import ExampleUseReducer from './components/examples/ExampleUseReducer'; import ExampleUseState from './components/examples/ExampleUseState'; import ThemeProvider from './components/examples/theme-switcher/ThemeProvider'; import InputAmount from './components/inputs/InputAmount'; +import ListTodo from './components/lists/ListTodo'; +import ListUser from './components/lists/ListUser'; function App(props) { // const { } = props; @@ -17,6 +22,14 @@ function App(props) { return ( <>
+
+

Todos

+ +
+

Users

+ +
+

Example Hooks

@@ -31,6 +44,15 @@ function App(props) {

+

Example useEffect Hook (did update)

+ +
+

Example useEffect Hook (unmount)

+ +
+

Example useEffect Hook (mount)

+ +

Example useId Hook (seit 2022)

diff --git a/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectDidUpdate.jsx b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectDidUpdate.jsx new file mode 100644 index 0000000..bb0ded2 --- /dev/null +++ b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectDidUpdate.jsx @@ -0,0 +1,32 @@ +import { useEffect, useState } from 'react'; +import { FaPlus } from 'react-icons/fa6'; + +const ExampleUseEffectDidUpdate = (props) => { + // const { } = props; + + const [value, setValue] = useState(0); + + useEffect(() => { + // mount + console.log('first render and rerender:', value); + + return () => { + // unmount + }; + }, [value]); // <-- wenn state sich ändert, wird useEffect erneut ausgeführt (update) + + // EventHandlers =========== + const handleClick = (e) => { + setValue(value + 1); + }; + + return ( +
+

The value is: {value}

+ +
+ ); +}; +export default ExampleUseEffectDidUpdate; diff --git a/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectMount.jsx b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectMount.jsx new file mode 100644 index 0000000..3b61117 --- /dev/null +++ b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectMount.jsx @@ -0,0 +1,28 @@ +import { useEffect } from 'react'; + +const ExampleUseEffectMount = (props) => { + // const { } = props; + + console.log(document.querySelector('#box')); // null + + useEffect(() => { + // mount + console.log(document.querySelector('#box')); // JSX liegt als gerendertes HTML vor + document.querySelector('#box').style.color = 'white'; + document.querySelector('#box').style.backgroundColor = '#222'; + document.querySelector('#box').style.padding = '1rem'; + + return () => { + // cleanup | unmount + }; + }, []); // did update (wenn state oder state-list verändert wird) + + return ( +
+
+

Box was rendered

+
+
+ ); +}; +export default ExampleUseEffectMount; diff --git a/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectUnMount.jsx b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectUnMount.jsx new file mode 100644 index 0000000..252e967 --- /dev/null +++ b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/examples/ExampleUseEffectUnMount.jsx @@ -0,0 +1,35 @@ +import { useEffect, useState } from 'react'; + +const ExampleUseEffectUnMount = (props) => { + // const { } = props; + + const [timer, setTimer] = useState(0); + + useEffect(() => { + // mount + const interval = setInterval(() => { + setTimer((prevTimer) => prevTimer + 1); + }, 1000); + + window.addEventListener('resize', handleResize); + return () => { + // cleanup | unmount + clearInterval(interval); + window.removeEventListener('resize', handleResize); + }; + }, []); + + // EventHandler ====== + const handleResize = (e) => { + console.log(e); + const { x, y } = document.body.getBoundingClientRect(); + console.log('resize:', { x, y }); + }; + + return ( +
+

Timer: {timer}

+
+ ); +}; +export default ExampleUseEffectUnMount; diff --git a/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/lists/ListTodo.jsx b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/lists/ListTodo.jsx new file mode 100644 index 0000000..ff72067 --- /dev/null +++ b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/lists/ListTodo.jsx @@ -0,0 +1,32 @@ +import { useEffect, useState } from 'react'; + +const ListTodo = (props) => { + // const { } = props; + + const [todos, setTodos] = useState([]); + + useEffect(() => { + fetch('https://dummyjson.com/todos/random/6') + .then((res) => res.json()) + .then((data) => { + setTodos(data); + }) + .catch((err) => { + console.error(err); + }); + + return () => {}; + }, []); + + return ( +
    + {todos.length > 0 && + todos.map(({ id, todo, completed, userId }, idx) => ( +
  • + {todo} +
  • + ))} +
+ ); +}; +export default ListTodo; diff --git a/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/lists/ListUser.jsx b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/lists/ListUser.jsx new file mode 100644 index 0000000..289377a --- /dev/null +++ b/05_react/unterricht/tag43/02_react-api-with-hooks/src/components/lists/ListUser.jsx @@ -0,0 +1,42 @@ +import axios from 'axios'; +import { useEffect, useState } from 'react'; + +const ListUser = (props) => { + // const { } = props; + + const [users, setUsers] = useState([]); + + useEffect(() => { + axios + .get('https://dummyjson.com/users?limit=6') + .then(({ data }) => { + console.log(data); + setUsers(data?.users); + }) + .catch((err) => { + console.error(err); + }); + + return () => {}; + }, []); + + return ( +
    + {users.length > 0 && + users.map(({ id, firstName, lastName, age, email }, idx) => ( +
  • +

    + Name: + {firstName} {lastName} +
    + age: {age} +
    + email: {email} +
    +

    +
  • + ))} +
+ ); +}; +export default ListUser;