Closed MichZipp closed 6 years ago
Hi Michael. What about:
...
var currentUser = new Document();
function setCurrentUser(uid) {
currentUser.path = "users/" + uid;
}
...
I think that will work.
regards, Hein
That's it, Thanks!
Where did you place this in your code, I am placing it on the auth state changed, and nothing so far
Hi,
I'm a beginner with react and firebase! I would like to have the current User in the store to access the data from different components. If I use the following Code, the currentUser Document is always empty. The "setCurrentUser" function is called, when a user has logged in. If I query the whole user collection with the user id, it works fine. But I think it would be more effitient to directly access the document.
Greetings, Michael