From f961c994e96546c155c80f160245ba50dfa31bb9 Mon Sep 17 00:00:00 2001
From: Emiel Noor Kautsar <101696571+emiel-tkp@users.noreply.github.com>
Date: Fri, 2 Dec 2022 16:00:05 +0700
Subject: [PATCH] Mini fix
---
src/components/TaskGame/components/Destructuring.js | 6 ++----
src/components/TaskGame/components/Fetching.js | 4 ++--
src/components/TaskGame/components/Props.js | 4 ++--
src/components/TaskGame/components/UseEffect.js | 2 +-
src/components/TaskGame/components/UseState.js | 2 +-
src/components/TaskGame/components/UseStateClosure.js | 2 +-
6 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/components/TaskGame/components/Destructuring.js b/src/components/TaskGame/components/Destructuring.js
index 2327ea0..f271b6b 100644
--- a/src/components/TaskGame/components/Destructuring.js
+++ b/src/components/TaskGame/components/Destructuring.js
@@ -12,10 +12,8 @@ function Destructuring(props) {
};
// TODO: Find the Bugs
- var color1 = colors.color1,
- color2 = colors.color1,
- color3 = colors.color1;
-
+ const {color1, color2, color3} = colors
+
return (
diff --git a/src/components/TaskGame/components/Fetching.js b/src/components/TaskGame/components/Fetching.js
index d9994f3..46b2817 100644
--- a/src/components/TaskGame/components/Fetching.js
+++ b/src/components/TaskGame/components/Fetching.js
@@ -15,11 +15,11 @@ function Fetching(props) {
.then((res) => res.json())
.then((resJson) => {
// TODO: Find the Bugs
- const pokemonList = resJson;
+ const pokemonList = resJson.results;
// TODO: Find the Bugs
// setPokemonList will broken the page
- // setPokemonList(pokemonList);
+ setPokemonList(pokemonList);
console.log(pokemonList);
});
}, []);
diff --git a/src/components/TaskGame/components/Props.js b/src/components/TaskGame/components/Props.js
index 48ddb6c..a05f7bc 100644
--- a/src/components/TaskGame/components/Props.js
+++ b/src/components/TaskGame/components/Props.js
@@ -24,11 +24,11 @@ function Props(props) {
{/* TODO: Find the Bugs */}
-
+
{/* TODO: Find the Bugs */}
-
+
diff --git a/src/components/TaskGame/components/UseEffect.js b/src/components/TaskGame/components/UseEffect.js
index 6ad8146..382367c 100644
--- a/src/components/TaskGame/components/UseEffect.js
+++ b/src/components/TaskGame/components/UseEffect.js
@@ -11,7 +11,7 @@ function UseEffect(props) {
// TODO: Find the Bugs
useEffect(() => {
setCount(Math.random);
- });
+ }, []);
return (
diff --git a/src/components/TaskGame/components/UseState.js b/src/components/TaskGame/components/UseState.js
index 8c5590e..51db1ba 100644
--- a/src/components/TaskGame/components/UseState.js
+++ b/src/components/TaskGame/components/UseState.js
@@ -3,7 +3,7 @@ import { Button, Divider } from "antd";
function UseState(props) {
const handleNext = () => {
// TODO: Find the Bugs
- props.setStep(1);
+ props.setStep(3);
};
return (
diff --git a/src/components/TaskGame/components/UseStateClosure.js b/src/components/TaskGame/components/UseStateClosure.js
index f6230ed..cf07838 100644
--- a/src/components/TaskGame/components/UseStateClosure.js
+++ b/src/components/TaskGame/components/UseStateClosure.js
@@ -13,7 +13,7 @@ function UseStateClosure(props) {
setTimeout(() => {
// TODO: Find the Bugs
setCount(count + 1);
- }, 1000);
+ }, 0);
};
return (