javascript - Meteor react js logged in user email -
i'm using meteor , react , im trying display logged in user's email address
this im using currentuseremail() { return meteor.user().emails[0].address; }, render() {
, in return have
<flatbutton label={this.currentuseremail()} primary={true} />
but im getting emails not defined
ive tried use <flatbutton label={meteor.user().emails[0].address} primary={true} />
directly im stil getting email undefined out
ive got solution
currentuseremail() { var userid = meteor.userid(); var user = meteor.users.findone({_id: userid}); return user.emails[0].address; }
, flat button label
<flatbutton label={this.currentuseremail()} primary={true} />