Skip to content

Commit 0323d7e

Browse files
Merge pull request #20 from kristof0425/refactor/change-lifecycle-method-in-examples
Refactor/change lifecycle method in examples
2 parents f797140 + d328352 commit 0323d7e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class SignInScreen extends React.Component {
125125
};
126126

127127
// Listen to the Firebase Auth state and set the local state.
128-
componentWillMount() {
128+
componentDidMount() {
129129
firebase.auth().onAuthStateChanged(
130130
(user) => this.setState({signedIn: !!user})
131131
);

example/src/App.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class App extends React.Component {
5555
/**
5656
* @inheritDoc
5757
*/
58-
componentWillMount() {
58+
componentDidMount() {
5959
firebaseApp.auth().onAuthStateChanged((user) => {
6060
this.setState({signedIn: !!user});
6161
});

0 commit comments

Comments
 (0)