0
我現在有我的反應,komposer設置是這樣的:是否可以通過React Komposer傳遞道具?
const composer = (params, onData) => {
const subscription = Meteor.subscribe('comments');
if (subscription.ready()) {
const comments = Comments.find({approved: true }, {sort: {timestamp: -1}}).fetch();
onData(null, { comments });
}
};
export default composeWithTracker(composer, Loading)(CommentsList);
我想什麼是另一種選擇傳遞給它基於該組件的道具我查找查詢。
所以我想它是這樣的:
const comments = Comments.find({approved: true, city: {activeCity} }, {sort: {timestamp: -1}}).fetch();
但是,這並不工作,我究竟做錯了什麼?