jeudi 28 juillet 2016

setState in $.get

Uncaught TypeError: undefined is not a function is throw when this.setState is use within the $.get scope, it works fine when I place the code outside the scope. How do you deal with it?

$.get(APIURL, function (data) {
   this.setState({resdata: "This is a new state"});
});

I'm not sure what is the best practice to replace JQuery AJAX to other small AJAX libraries. Please advice.

Aucun commentaire:

Enregistrer un commentaire