Open bsbechtel opened 7 years ago
@bsbechtel I am having the same problem... Any luck?
No, I just logged in when receiving the result and haven't touched the code since. It would be nice if one of the maintainers could provide some input.
@PolGuixe @bsbechtel I had a similar issue and was able to work around it here: https://github.com/inProgress-team/react-native-meteor/issues/239
I did the same thing as you (calling Meteor.loginWithPassword()
within an Accounts.createUser()
. I also found another bug with the userId
getting unset on reconnects and solved it with an internal react-native-meteor
function. I don't think any of these solutions is ideal however.
I am using react-navigation, along with version 1.0.3 of react-native-meteor, and it appears that Accounts.createUser doesn't reactively update the user object in the same way Meteor.loginWithPassword does.
I originally thought this was a react-native re-rendering issue with react-navigation, but after moving around the screens and structure of my components, along with testing for re-rendering via console.log statements everywhere in my code, I am thinking this is just different behavior found in this package (possibly related to behavior related to AsyncStorage? see issue #19)
My code is roughly as follows:
user data container:
App:
AuthStack:
Login:
Register:
To work around this issue, you can see I called
Meteor.loginWithPassword()
on a successfulAccounts.createUser()
call, but I don't think things should really work this way.I wanted to open this issue to see if there was a difference in how the two methods are implemented in this package that changes how
Meteor.user()
is reactively updated. Thanks!