Skip to content

Commit 6797388

Browse files
committed
fix: find the bugs fasma
Motivation - there are some bugs Changes - find and fix the bugs
1 parent 4d78396 commit 6797388

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/components/TaskGame/components/Destructuring.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ function Destructuring(props) {
1212
};
1313

1414
// TODO: Find the Bugs
15-
var color1 = colors.color1,
16-
color2 = colors.color1,
17-
color3 = colors.color1;
15+
// var color1 = colors.color1,
16+
// color2 = colors.color2,
17+
// color3 = colors.color3;
18+
var { color1, color2, color3 } = colors
1819

1920
return (
2021
<div>

src/components/TaskGame/components/Fetching.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ function Fetching(props) {
1919

2020
// TODO: Find the Bugs
2121
// setPokemonList will broken the page
22-
// setPokemonList(pokemonList);
23-
console.log(pokemonList);
22+
setPokemonList(pokemonList.results);
2423
});
2524
}, []);
2625

src/components/TaskGame/components/Props.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ function Props(props) {
2424
</Col>
2525
<Col span={4}>
2626
{/* TODO: Find the Bugs */}
27-
<Square />
27+
<Square backgroundColor={color2} />
2828
</Col>
2929
<Col span={4}>
3030
{/* TODO: Find the Bugs */}
31-
<Square />
31+
<Square backgroundColor={color3} />
3232
</Col>
3333
</Row>
3434
</div>

src/components/TaskGame/components/UseEffect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function UseEffect(props) {
1111
// TODO: Find the Bugs
1212
useEffect(() => {
1313
setCount(Math.random);
14-
});
14+
}, []);
1515

1616
return (
1717
<div>

src/components/TaskGame/components/UseState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Button, Divider } from "antd";
33
function UseState(props) {
44
const handleNext = () => {
55
// TODO: Find the Bugs
6-
props.setStep(1);
6+
props.setStep(3);
77
};
88

99
return (

src/components/TaskGame/components/UseStateClosure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function UseStateClosure(props) {
1212
console.log("handlernya sudah onclick");
1313
setTimeout(() => {
1414
// TODO: Find the Bugs
15-
setCount(count + 1);
15+
setCount(count => count + 1);
1616
}, 1000);
1717
};
1818

0 commit comments

Comments
 (0)