This is peculiar.
I'm passing an array consisting of a single object to a React component's Render method:
let content = this.state.links.map(link => { // eslint-disable-line
return (
<li key={link._id}>
<a href={link.link}>{link.title}</a>
</li>
);
});
return (
<h3>
<ul>
{content}
</ul>
</h3>
);
This is the output of this.state.links :
[{"_id":"56f9b418657c2d2353611b0f","link":"https://facebook.github.io/flux/","title":"flux"}]
It's an array with one object. How come I'm getting this error?:
UPDATE: I've kinda found the problematic code:
It's fine going into here:
const _getAppState = () => { // eslint-disable-line
return {
links: LinkStore.getAll(),
};
};
LinkStore.getAll() still returns an array with an object.
Then the next time we call the above function:
onChange() {
console.log('4. In the View', _getAppState());
// this.setState(_getAppState());
}
Still not totally sure when and how it transforms into a string. If you want to dig into the code and see for yourself, here is the repo.


console.log(typeof this.state.links)?