Skip to content

Unrecognized value. Skipped inserting #771

Answered by lxsmnsyc
bobwatcherx asked this question in Q&A
Discussion options

You must be logged in to vote
result.forEach((p)=>{
  setPost({mid:p.id,mtitle:p.title})
})

This is your issue. The solutions:

const posts = [];
result.forEach((p)=>{
  posts.push({mid:p.id,mtitle:p.title})
})
setPost(posts);

or

setPost(result.map((p) => ({mid:p.id,mtitle:p.title})));

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ryansolid
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@linusjf
Comment options

@linusjf
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
4 participants
Converted from issue

This discussion was converted from issue #765 on December 24, 2021 06:20.