react snippet
const { post } = this.props; if(!post){ return <div></div>; } To deal with undefined props