Skip to content

Commit dabc101

Browse files
committed
Fix refresh button
1 parent 8e2d3a4 commit dabc101

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import React from "react";
2-
import { connect } from "react-redux";
2+
import { useDispatch } from "react-redux";
33

44
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
55
import { faSyncAlt } from "@fortawesome/free-solid-svg-icons";
66
import { refresh } from "../redux/actions";
77

88
function RefreshButton() {
9+
const dispatch = useDispatch();
910
return (
1011
<div>
11-
<button className="btn refresh-btn" onClick={() => refresh()}>
12+
<button className="btn refresh-btn" onClick={() => dispatch(refresh())}>
1213
<FontAwesomeIcon icon={faSyncAlt} />
1314
</button>
1415
</div>
1516
);
1617
}
1718

18-
export default connect((x) => x, { refresh })(RefreshButton);
19+
export default RefreshButton;

0 commit comments

Comments
 (0)