Skip to content

Instantly share code, notes, and snippets.

@dennyjohnk
Created October 22, 2019 16:07
Show Gist options
  • Save dennyjohnk/04f8b4392317098bb1dbb5b73bc998bc to your computer and use it in GitHub Desktop.
Save dennyjohnk/04f8b4392317098bb1dbb5b73bc998bc to your computer and use it in GitHub Desktop.
const Post = props => { ---> is it possible to destructure ths to /*** const Post = props => { ****/ ? Just becoz am using props.history.push am not able to desctructure this :(
const post = props.post;
return (
<div className="post-container" key={post.id}>
{post.companyName ? <CompanyInfo companyName={post.companyName} /> : ""}
<UserInfo post={post} />
<div
className="cursor-pointer post-title"
onClick={() => props.history.push("/post/" + post.url)}
>
{post.title}
</div>
<div className="post-title-container ">
<p className=" post-description truncate-description">
{post.description}
</p>
</div>
<ActionBar post={post} />
<div className="break-line"></div>
<Footer post={post} />
</div>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment