📌  相关文章
📜  TypeError:this.setstate 不是函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:08.288000             🧑  作者: Mango

代码示例2
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 });
    }