In my react code I have items as an array in my state.
items[]
I was able to populate items array with few data and need to pass it to my web service. First I need to convert that array to json. This is just crashing for me when I do the Json.stringify.
Is there a different way to do it in react application?
storeDataInDatabase(){
const myObjStr = JSON.stringify(this.props.items);
console.log(myObjStr);
}
stateinitially then usepropsin your example. Which is it? What is the error? "just crashing for me" doesn't tell us much.items[]? It looks like you forgot a string in a property accessor, but you're saying it's an array.