Skip to content

loadProps Nirvana #34

@ChiefORZ

Description

@ChiefORZ

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions