There was an error while loading. Please reload this page.
1 parent 05dd479 commit c4d3109Copy full SHA for c4d3109
sort-articles/src/App.js
@@ -9,6 +9,11 @@ const title = "Sorting Articles";
9
function App({articles}) {
10
const [articlesList, setArticlesList] = useState(articles);
11
12
+ useEffect(() => {
13
+ sortByUpvotes(articles);
14
+ },[]);
15
+
16
17
const sortByUpvotes = () => {
18
var newArticles = [];
19
Object.assign(newArticles, articlesList);
0 commit comments