diff --git a/src/components/TaskGame/components/Destructuring.js b/src/components/TaskGame/components/Destructuring.js index 2327ea0..210de3a 100644 --- a/src/components/TaskGame/components/Destructuring.js +++ b/src/components/TaskGame/components/Destructuring.js @@ -13,8 +13,8 @@ function Destructuring(props) { // TODO: Find the Bugs var color1 = colors.color1, - color2 = colors.color1, - color3 = colors.color1; + color2 = colors.color2, + color3 = colors.color3; return (
diff --git a/src/components/TaskGame/components/Fetching.js b/src/components/TaskGame/components/Fetching.js index d9994f3..5099bea 100644 --- a/src/components/TaskGame/components/Fetching.js +++ b/src/components/TaskGame/components/Fetching.js @@ -15,11 +15,10 @@ 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..63f40a6 100644 --- a/src/components/TaskGame/components/UseStateClosure.js +++ b/src/components/TaskGame/components/UseStateClosure.js @@ -12,7 +12,7 @@ function UseStateClosure(props) { console.log("handlernya sudah onclick"); setTimeout(() => { // TODO: Find the Bugs - setCount(count + 1); + setCount(count => count + 1); }, 1000); };