Skip to content

Instantly share code, notes, and snippets.

Created August 20, 2021 05:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
const order = (posts) => {
return posts.sort((a, b) => {
return b.get("createdAt") - a.get("createdAt");
return (
<div className="App">
<header className="app-header">
<img className="logo" alt="back4app's logo" src={''} />
<h2 className="spacing">parse hooks</h2>
<span>social network</span>
<div className="posts-container">
<form onSubmit={handleSubmitPost}className="actions">
<textarea value={postText} onChange={event => setPostText(event.currentTarget.value)}/>
<button type="submit">post</button>
<div className="post-list">
{results && order(results).map((user,index) => (
<div className="post" key={index}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment