Skip to content

Commit d94a2d8

Browse files
authored
fix(auth): correct modular AuthListenerCallback type (#8436)
1 parent d4d02d1 commit d94a2d8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/auth/lib/modular/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
import { ReactNativeFirebase } from '@react-native-firebase/app';
19-
import { FirebaseAuthTypes, CallbackOrObserver, AuthListenerCallback } from '../index';
19+
import { FirebaseAuthTypes, CallbackOrObserver } from '../index';
2020
import { firebase } from '..';
2121

2222
import Auth = FirebaseAuthTypes.Module;
@@ -182,7 +182,7 @@ export function isSignInWithEmailLink(auth: Auth, emailLink: string): boolean;
182182
*/
183183
export function onAuthStateChanged(
184184
auth: Auth,
185-
nextOrObserver: CallbackOrObserver<AuthListenerCallback>,
185+
nextOrObserver: CallbackOrObserver<FirebaseAuthTypes.AuthListenerCallback>,
186186
): () => void;
187187

188188
/**
@@ -194,7 +194,7 @@ export function onAuthStateChanged(
194194
*/
195195
export function onIdTokenChanged(
196196
auth: Auth,
197-
nextOrObserver: CallbackOrObserver<AuthListenerCallback>,
197+
nextOrObserver: CallbackOrObserver<FirebaseAuthTypes.AuthListenerCallback>,
198198
): () => void;
199199

200200
/**

packages/auth/type-test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// import firebase from '@react-native-firebase/app';
2-
import firebase, { FirebaseAuthTypes, signInWithPhoneNumber } from '.';
2+
import firebase, { FirebaseAuthTypes, onAuthStateChanged, signInWithPhoneNumber} from '.';
33

44
console.log(firebase.default().currentUser);
55

@@ -55,4 +55,5 @@ firebase.auth().signInAnonymously().then();
5555
firebase.auth().signInWithEmailAndPassword('', '').then();
5656

5757
// Verify Modular API
58+
onAuthStateChanged(firebase.auth(), user => console.log(user));
5859
signInWithPhoneNumber(firebase.auth(), '+1234567890');

0 commit comments

Comments
 (0)