我刚开始学习 React,我试图弄清楚如何找到我正在寻找的特定值。就像你在 Ruby 中有 each.do 方法并且你可以遍历一个数组一样,我正在尝试用 React 来做到这一点。
class Gallery extends React.Component {
render () {
// debugger;
return (
<div>
<img> {this.props.gallery.thumbnail_url} </img>
</div>
)
}
}
我正在尝试访问 thumbnail._url 并且在使用调试器时,我无法访问所有对象和图像。我想到了 this.props.gallery.object.thumbnail_url 和其他想法,但我不确定最好的方法!