我有一个组件,其中包含指向另一个组件的链接,并希望将数据传递给它(以显示该对象的详细信息)。 我认为这很简单,但似乎无法让它发挥作用!
所以我有一个带链接的组件:
export const Person = React.createClass({
render: function() {
return (
<div>
<h4>{this.props.person.get('full_name')}</h4>
</div>
<div>
<Link to="/person/detail" params={person: this.props.person}>View Details</Link>
</div>
);
}
});
并希望将此人的详细信息传递给此组件:
export const PersonDetails = React.createClass({
render: function() {
return (
<div>
{console.log(this.props.person)}
<h4>The Details...</h4>
</div>
<Link to="/person">Back</Link>
);
}
});
并且console.log显示未定义。我在这里错过了什么?任何帮助将不胜感激。