Open sergeybataev opened 9 years ago
it's may be not a good solution, but works:
this.setState({
topics: data.data.map(
function(topic,key) {
return createFragment(topic)
}
)
})
any suggestions?
I'm having the same issue, but for me createFragment isn't even a function. I'll be happy to hear if you've found a better solution for this issue. Thanks!
use topic.name instead of topic in
renderTopics: function() {
return this.state.topics.map(function(topic) {
return <li>
{topic.name}
</li>
})
}
Console log: Uncaught (in promise) Error: Invariant Violation: Objects are not valid as a React child (found: object with keys {id, name, description, css, ephemeral, readonly}). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of
exports
.(anonymous function) @ topicList.jsx:13