Im trying to spit out Data from a Wordpress CMS in my nextJS app. This is an. ACF Repeater field. I get the data just fine via the editor but trying to use map to push it to the page i just get [object object] back.
Below is the code in question -- AM I just misunderstanding how Map is suppose to work?
<div className="steve"
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: node.GlobalFAQ.faq.map((data) => (
<div>
{data.question}
{data.answer}
</div>
)),
}}
/>
Here is what is returned to me
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
This code works fine, this isnt calling a repeater just a field from an ACF group.
<div className={blogStyles.blocksContainer}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: node.AboutBlocks.blockThree }}
/>
Then Below is my query
query AllPosts {
posts(where: {id: 25}) {
edges {
node {
id
date
title
slug
Header {
headerImage {
mediaItemUrl
}
headerText
}
AboutBlocks {
blockOne
blockThree
blockTwo
}
SalesBlock {
salesBlockOne
salesBlockThree
salesBlockTwo
}
title
GlobalFAQ {
faq {
question
answer
}
}
}
}
}
}
Here is what I get when I console out node.GlobalFAQ.faq
Array(6)
0: {question: "How do I pay for my order?", answer: "
We’ll include an order summary link with …ike you would at any other e-commerce store.
↵"} 1: {question: "How do I know I'll get my wheels?", answer: "Want to do your research before sending over mo…#8217;s nice to know that it’s there).
↵"} 2: {question: "What if I found a lower price than you quoted?", answer: "Wow. You must have found a really good deal. Se… we’ll try, every once in a while we can’t.)
↵"} 3: {question: "Are you selling second run or blemished wheels?", answer: "No. Unless specifically listed as a blemished w…ew, first run, and manufactured warrantied.
↵"} 4: {question: "Do you sell tires too?", answer: "Yes. We have access to discounted pricing on a …els. Let us know what you’d like HERE.
↵"} 5: {question: "How can you sell wheels for cheaper than other places?", answer: "There are two main reasons we can sell for so c…rice can then be passed on to our customers.
↵"} length: 6 proto: Array(0)