I don’t understand what I’m doing wrong? How do I get all the users from Meteor.users?
Roles = React.createClass({
mixins: [ReactMeteorData],
getMeteorData() {
Meteor.subscribe('directory');
return {
users: Meteor.users.find({}).fetch(),
}
},
getUsers() {
// Get tasks from this.data.tasks
return this.data.users.map((users) => {
return <Users key={users._id} users={users} />;
});
},
render() {
return (
<div className="container">
<div className="employee">
<label htmlFor="employee">Employee Name:</label>
{this.getUsers()}
</div>
</div>
)
}
});
Users = React.createClass({
render() {
<div>
{this.props.users.firstName}
</div>
}
});
Meteor.publish("directory", function () {
return Meteor.users.find({}, {fields: {profile: 1}});
});