What is the best approach when passing Objects through props?

Hi all,

I want to fetch all of the custom taxonomies and show them on a page.
However when i pass them as Objects i can’t use .map for each of them. Do you know what would be the best approach to loop them? (see Screenshots)

Many thanks.
All the best,
Dejan


Hi @dejangeorgiev

You can loop over the keys in an object with something like:

Object.keys(myObject).forEach( key =>  {...})
1 Like

Hello @mburridge,

Thank you very much for the help. However i was able to fix it with .map function, just a different approach.

Do you have any idea how to get the taxonomy description and i am sure it is included in the api?

Many thanks.
All the best,
Dejan

Hi @dejangeorgiev

Glad you managed to fix your issue.

Regarding the description I can confirm that it is sent from the WP REST API, and also that it isn’t showing in frontity.state.

I’m not sure why, but I’ve referred this to the dev team. I’ll let you know as soon as I hear back from them.

1 Like

Hi @mburridge

Thank you so much.
Looking forward to hear from you regarding the taxonomy description.

Best,
Dejan

Hi @dejangeorgiev

As I said earlier, I referred this issue to our dev team. Here is what they replied: