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} />


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo