javascript - Anyone else getting an undefined object when promising firebase.auth().signOut() in react native? -


my logout function listed below. how i'm implementing it. not sure what's causing promise come undefined. it's not binding issue. i've tested that.

logout() {   firebase.auth().signout()     .then((respnose) => {       console.log(respnose)     })     .catch((error) => {       console.log('error on logging out: ' + error)     }) }  <header   statusbarprops={{ barstyle: 'light-content' }}   leftcomponent={{ icon: 'menu', color: '#fff' }}   centercomponent={{ text: 'chat room', style: { color: '#fff' } }}   rightcomponent={<icon name='logout' color='white' type='material-community' onpress={this.logout}/>} /> 

i'm using react-native-elements.

try because on success has no response on error has error object in fact signed out case error since response undefined

const thisclass = this; //  here how assign variable  firebase.auth().signout().then(() => {  // sign-out successful.     console.log('signed out');   thisclass.props.myprop // here how can access this.props   thisclass.setstate({ mynewstate }) //  here how can set state  }, (error) => { console.log(error); }); 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -