Skip to content

Commit c4d3109

Browse files
Update App.js
1 parent 05dd479 commit c4d3109

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sort-articles/src/App.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ const title = "Sorting Articles";
99
function App({articles}) {
1010
const [articlesList, setArticlesList] = useState(articles);
1111

12+
useEffect(() => {
13+
sortByUpvotes(articles);
14+
},[]);
15+
16+
1217
const sortByUpvotes = () => {
1318
var newArticles = [];
1419
Object.assign(newArticles, articlesList);

0 commit comments

Comments
 (0)