diff --git a/src/components/TaskGame/components/Destructuring.js b/src/components/TaskGame/components/Destructuring.js index 2327ea0..f7477ec 100644 --- a/src/components/TaskGame/components/Destructuring.js +++ b/src/components/TaskGame/components/Destructuring.js @@ -12,9 +12,7 @@ function Destructuring(props) { }; // TODO: Find the Bugs - var color1 = colors.color1, - color2 = colors.color1, - color3 = colors.color1; + let {color1,color2,color3} = colors return (
diff --git a/src/components/TaskGame/components/Fetching.js b/src/components/TaskGame/components/Fetching.js index d9994f3..3eda6ef 100644 --- a/src/components/TaskGame/components/Fetching.js +++ b/src/components/TaskGame/components/Fetching.js @@ -21,6 +21,7 @@ function Fetching(props) { // setPokemonList will broken the page // setPokemonList(pokemonList); console.log(pokemonList); + setPokemonList(pokemonList.results) }); }, []); 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..9e5041f 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); }; diff --git a/src/components/TaskIntro/index.js b/src/components/TaskIntro/index.js index ba154ab..7da1af5 100644 --- a/src/components/TaskIntro/index.js +++ b/src/components/TaskIntro/index.js @@ -7,7 +7,7 @@ function TaskIntro() { useEffect(() => { setInterval(() => { setIsProgress(false); - }, 10000); + }, 10); }); return (