ParseReact icon indicating copy to clipboard operation
ParseReact copied to clipboard

ParseReact.currentUser not refreshing

Open matthewfcarlson opened this issue 9 years ago • 2 comments

I'm running into some issues getting the anyBudget demo code to function. I've deployed a Parse backend to Heroku, which is running fine (2.2.18). It is configured to serve the static JS, CSS, and html files (which are bundled with browserify). In the login wrapper, I can see that the observe is getting set and the subscription is being passed back. I can see the login request going out to parse and coming back successfully with the correct data. I can request Parse.User.current() and get the current user. The real problem comes from this.data.user in the render function. Relevant code snippets included.

observe: function() {
    return {
      user: ParseReact.currentUser
    };
  },

  render: function() {
    if (this.data.user) {
      return (
        <div>
          <a class...

matthewfcarlson avatar Sep 02 '16 17:09 matthewfcarlson

I was doing the same now and its working for me. here are my versions "dependencies": { "parse": "^1.6.14", "parse-react": "^0.5.2", "react": "^15.3.2", "react-dom": "^15.3.2" },

and my code

observe(props, state){ return{ user: ParseReact.currentUser } } componentDidMount(){ Parse.User.logIn("user", "user", { success: function(user) { // Do stuff after successful login. }, error: function(user, error) { // The login failed. Check error to see why. } }); } render() { console.log(this.data.user.objectId); return(){} }

agent3bood avatar Sep 26 '16 18:09 agent3bood

I'm having this same issue, not quite sure what's up. I will say though, when I run locally, it works like a charm, but as soon as I run my API on a hosted VPS it acts up.

ryanis-online avatar Oct 25 '16 02:10 ryanis-online