-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Hi There, just want to say that I love your guides, and I think they're more well explained and paced than most out there. I just had a question about the componentWIllMount() Code in App.js.
this.removeAuthListener = app.auth().onAuthStateChanged((user) => {
I actually understand that it's a listener that listens for changes in authentication state. What I'm confused is how you're assigning to a ref and calling it later? I though that functions inside a component had to be bound in the constructor like "this.function.bind(this)", Could you refer me to reference for documentation for this?
componentWillUnmount() {
console.log("Yo unmounting");
this.removeAuthListener();
base.removeBinding(this.songsRef);
}
And in the componentWillUnmount hook, you can call the function again, but the function was created or initiated in a "componentWillMount". Does that carry into the global scope of the entire component?
Metadata
Metadata
Assignees
Labels
No labels