Skip to content

Commit 54ae7e6

Browse files
authored
Merge pull request #1 from niravlogistic/patch-1
Update App.js
2 parents 05dd479 + c4d3109 commit 54ae7e6

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)