Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

Property does not exist on type 'function'

$
0
0

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()


Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>