I am trying to display a list of fields that have been changed upon saving. To do this, I need to map through a very complex object consisting of both objects and arrays. The issue is in this part of the object right now:
suppressionRules: {
additional_offer_ids: [2568]
duration: {type: "days", amount: 7}
suppression_type: "accepted"
proto__: Object
}
For some reason, it's coming up as this when I display it:
suppressionRules: [object Object]
This is the function I'm using to display the changed fields in the object:
function NumberList() {
if (initialValues !== formValues) {
const listItems = Object.keys(getChangedValues).map(item => {
console.log(item + ' ' + getChangedValues[item]);
return <li>{`${item}: ${getChangedValues[item]}`}</li>;
});
return <ul>{listItems}</ul>;
}
return null;
}
I need help on how to make it so that the suppressionRules actually shows the fields inside of it.