I am trying to use the firebase.auth method in a function using typescript and I am getting a Property 'name' does not exist on type 'Function' (ts 2339). I must be missing something simple here, however not quite sure what it is.
const registerUser = (email: String, password: String) => { console.log(email, password); return (firebase.auth as Function) .createUserWithEmailAndPassword(email, password) .then((userObj: Object) => console.log(email, password, userObj)) .catch((error: Error) => console.log('Error logging in.', error));};
The problem happens with the .createUserWithEmailAndPassword
PROBLEM SOLVED: I tried to solve the problem by casting firebase.auth as type Function, it is easily solved by removing that and calling it by firebase.auth()