[Vuejs]-Vue + TypeScript + Firebase: How to Type an object containing a `ref` of a firebase `User`?

0👍

Figured it out.

The problem was that the object { user } is actually shorthand for { user: USER-KEY-VALUE-HERE }. Which in my case was { user: Ref<User | null> }.

Therefore the final return Type becomes:

const getUser = (): { user: Ref<User | null> } => {
  return { user };
};

Leave a comment