diff --git a/src/App.js b/src/App.js index 5b49d6f..03bd1b7 100644 --- a/src/App.js +++ b/src/App.js @@ -35,7 +35,7 @@ const App = () => { const recursiveSort = (posts) => { posts.forEach((post, index) => {posts[index].comments = recursiveSort(post.comments)}); - posts.sort((a, b) => a.date < b.date); + posts.sort((a, b) => a.date < b.date ? 1 : -1); return posts; }