0
是否有可能以这种方式找到用户和抓取信息?试图流星+ React + createContainer - 用户资料查找
console.log(this.props.userDetails)
这里的时候,我得到unidentified
是我createContainer配置
export default createContainer(() => {
const userDetails = Meteor.users.find({ _id: 'WSLuMFqofmks5i99F' }).fetch().profile
return { userDetails };
}, userProfile);
假设一个有效的ID将被传递和结果将作为道具USERPROFILE组件
正确的答案,你也可以解释,那'找到()'光标返回从查询找到的所有文件。在该游标上调用fetch()会创建一个文档数组,即光标指向的数组。 Noe在该数组上调用'.profile()'返回(可以理解)'undefined'。只是为了让OP明白这个'undefined'是如何创建的以及底层机制是什么。 – Jankapunkt