Skip to content

Tag: json

Update Select When New Category Added

hi guys i want to update select options when user add new category can anyone tell me how to do this ? i want to update option with new item added in this part of code Answer If you want React re-render your component when new category added, add local state to it. Here is the updated code:

Having trouble displaying object property

I’m building a small pokedex using PokeAPI. I’m retrieving data from an endpoint and building my own object. The function that I’ve built for the latter runs on page load as follows: I’m able to console log the object and traverse it in devtools, and also able to JSON stringify it and …

How to extract all arrays in json object

I have a json object which has a collection of countries. Each country can have multiple regions which are represented in an array. I want to get the regions only and put all regions into one list.However when I map the data it doesn’t put all the regions in a list. What am I missing here? Here is the c…