Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadProps Nirvana #34

Closed
ChiefORZ opened this issue Jan 11, 2016 · 5 comments
Closed

loadProps Nirvana #34

ChiefORZ opened this issue Jan 11, 2016 · 5 comments

Comments

@ChiefORZ
Copy link

I discovered that the static loadProps method has to be defined in all Components, otherwise the async-props will not receive an callback and update - easy enough.

So i defined empty callbacks for testing purposes

statics: {
  loadProps: function(params, cb) {
    cb(null);
  }
}

funny thing: the { loading } = this.props in the root component does get updated correctly but the { this.props.children } does not recognize any changes...

so i had wo hack the system a bit and call it with an zero timeout and whoop - it works:

statics: {
  loadProps: function(params, cb) {
    setTimeout(function() {
      cb(null);
    },0);
  }
}

don't know it is an bug - or an feature :)

@zackify
Copy link

zackify commented Jan 11, 2016

Sure you're on the latest version? This was fixed a while back.

@ChiefORZ
Copy link
Author

Yes, I am.

If it helps, i uploaded the repo at https://github.com/ChiefORZ/super-sexy-react/tree/feature/async-props
make sure you are on the feature/async-props branch

@ChiefORZ
Copy link
Author

#40 fixed it!

@zackify
Copy link

zackify commented Jan 14, 2016

Yessss!
On Thu, Jan 14, 2016 at 03:44 ChiefORZ notifications@github.com wrote:

#40 #40 fixed it!


Reply to this email directly or view it on GitHub
#34 (comment).

@ryanflorence
Copy link
Owner

this is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants