javascript - setState of Undefined & User Authentication Error. Tried .bind(this). Tried fatpipe... Can't get it working -
i have 2 problems actually. first thing using componentwillmount or componentdidmount check user return asynchronous goes firebase check current user, , if statement not run there no user. tried solve promise, maybe understanding of promise isn't gave on , tried work inner code. substituted mount componentwillupdate seems run multiple times forcefully bypass error , check if state changed correctly. this leads me second problem. setstate says undefined. i've read on stack overflow , tried use ".bind(this)" , fatpipe, neither working. perhaps i'm putting in wrong place or syntax wrong. can help? import react, { component } 'react'; import search './search' import recipe './recipe' import fire '../fire' //import firebase 'firebase' class favourites extends component { constructor(props){ super(props); this.state = { recipes: [] } } componentdidupdate() { ...