1
userid(uid){
    this.state.userid.map((user)=>{
      if(uid===user._id){
        console.log(user.username)
        return user.username
      }
    })
  }

<div style={{width:"80%"}}>

{this.state.posts.map(post=>
  <div key={post._id.toString()}>
    <div className="modal-content"><br/>
    <a >{this.**userid**(post.user_id)}</a>        
    <b>Title: {post.title}</b><br/>
    <div><b>Message: </b>{post.message}</div>

I'm calling the user id from the return render, but it is not returning back, is there any way to return

Nah
  • 1,690
  • 2
  • 26
  • 46
Rajesh Kumar J
  • 219
  • 1
  • 5
  • 8
  • Problem appears in `if(uid===user._id){` you are not passing uid to your callback function, only passing `user` object. Hence it never pass the result. – Nah May 08 '18 at 07:16
  • yea, but how could i modify now to get the exact return – Rajesh Kumar J May 08 '18 at 07:17

0 Answers0