Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

TypeError: this.setstate is not a function

Make sure you use arrow functions to correctly bind 'this'

 handlePageChange = (page) => {
        this.setState({ currentPage: page });
    }

This will give you 'this.setstate is not a function'

 handlePageChange(page){
        this.setState({ currentPage: page });
    }
    
    
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #function
ADD COMMENT
Topic
Name
9+4 =