We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61fdab5 commit 827b168Copy full SHA for 827b168
example/src/App.jsx
@@ -56,9 +56,16 @@ class App extends React.Component {
56
* @inheritDoc
57
*/
58
componentDidMount() {
59
- firebaseApp.auth().onAuthStateChanged((user) => {
60
- this.setState({signedIn: !!user});
61
- });
+ this.unregisterAuthObserver = firebaseApp.auth().onAuthStateChanged(
+ (user) => this.setState({signedIn: !!user}
+ );
62
+ }
63
+
64
+ /**
65
+ * @inheritDoc
66
+ */
67
+ componentWillUnmount() {
68
+ this.unregisterAuthObserver();
69
}
70
71
/**
0 commit comments