You're using function() in your Promise chain, this will change the scope for this. If you're using ES6 I suggest you use the arrow function to maintain the class scope. Example:

You're using

axios.get(APP_URL, { params: params})
.then(function(response) { // this resets the scope
this.setState({
videos:response
})
})

Try using arrow functions:

axios.get(APP_URL, { params: params})
.then((response) => {
this.setState({
videos:response
})
})

Cannot read property 'setState' of undefined的更多相关文章

  1. react报错 TypeError: Cannot read property 'setState' of undefined

    代码如下: class test extends Component { constructor(props) { super(props); this.state = { liked: false ...

  2. easyui Datagrid查询报错Uncaught TypeError:Cannot read property 'length' of undefined

    1.问题描述 easyui中datagrid执行loadData方法出现如下异常:Cannot read property 'length' of undefined 2.一开始怀疑是js或者页面的问 ...

  3. vue.common.js?e881:433 TypeError: Cannot read property 'nodeName' of undefined

    我觉得吧,是这么个原因,就是响应式要找这个node改它的内容,没找着,就报错了. 用computed监控vuex的state属性,绑定到页面上,如果这个属性改了,因为响应式,那么就要更改页面,如果页面 ...

  4. Uncaught TypeError: Cannot read property 'msie' of undefined

    因为图方便,抄了别人写的一个jquerry插件,运行时“var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ...

  5. SharePoint 2013 Error - TypeError: Unable to get property 'replace' of undefined or null reference

    错误信息 TypeError: Unable to get property ‘replace’ of undefined or null referenceTypeError: Unable to ...

  6. jquery错误: Cannot read property ‘msie’ of undefined

    背景 Web application, 引用了jquery 1.10.2和fancybox 1.3.4 现象 访问页面遭遇Cannot read property ‘msie’ of undefine ...

  7. easyui使用时出现这个Uncaught TypeError: Cannot read property 'combo' of undefined

    easyui使用时出现这个Uncaught TypeError: Cannot read property 'nodeName' of undefined 最后检查发现是必须给select一个id,光 ...

  8. [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法

    参考 [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法 ---------------------------------------- ...

  9. [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法

    最近把一个项目的jQuery升级到最新版,发现有些页面报错Cannot read property ‘msie’ of undefined.上jQuery网站上搜了一下,原因是$.browser这个a ...

随机推荐

  1. laravel5.5中查询构造器的使用

    //查询构造器新增数据: public function query1() { /* $bool=DB::table('student')->insert( ['name'=>'小李',' ...

  2. RxJava 中的Map函数原理分析

    首先看一段Map函数的使用代码: Observable.create(new Observable.OnSubscribe<Integer>() { @Override public vo ...

  3. [WinForm]Dundas Chart控件学习(附源码)

    1.Dundas公司简介 加拿大的一家公司,专业做图表展现的,很牛,据说现在被Microsoft收购了.官网地址:http://www.dundas.com/ 2.Chart基本要素 3.最简单的柱状 ...

  4. 十六、dbms_space_admin(提供了局部管理表空间的功能)

    1.概述 作用:提供了局部管理表空间的功能 2.包的组成 1).segment_verify作用:用于检查段的区映像是否与位图一致语法:dbms_space_admin.segment_verify( ...

  5. C++内存分配与对象构造的分离

    在C++中,我们基本用new(delete)操作符分配(释放)内存.new操作符为特定类型分配内存,并在新分配的内存中构造该类型的一个对象.new表达式自动运行合适的构造函数来初始化每个动态分配的类类 ...

  6. html5: 幽灵按钮

    html: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF ...

  7. SSH服务:packet_write_wait: Connection to 67.218.143.160 port 22: Broken pipe错误处理

    1.在~/.ssh/config配置文件中添加 IPQoS lowdelay throughput 2.在/etc/ssh/ssh_config配置文件中添加 IPQoS lowdelay throu ...

  8. currentTarget,this,target区别

    currentTarget  : 事件处理程序当前正在处理事件的那个元素 this : 当前的事件发生的元素 target : 事件的目标 currentTarget和this值是始终相等的,但是ta ...

  9. iOS开发之如何在Xcode中显示断点堆栈

    昨天有人问我在Xcode中打断点后怎么查看堆栈,今天就简单的聊聊. 首先解释一下,什么是堆栈? 堆:顺序随意:栈区(stack)- 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等.其操作方式 ...

  10. iOS开发-Realm数据库

    Realm Realm-Object-c,见:https://realm.io/cn/docs/objc/latest/Realm官网:https://realm.io 使用流程 导入头文件#impo ...