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
Post a Comment