Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

this.setstate is not a function

VK.api('users.get',{fields: 'photo_50'},function(data){
    if(data.response){
        this.setState({ //the error happens here
            FirstName: data.response[0].first_name
        });
        console.info(this.state.FirstName);
    }

}.bind(this));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #function
ADD COMMENT
Topic
Name
9+7 =