这篇东西以后慢慢补充。

 

Q:今天遇到一个问题是 TypeError:dispatch is not a function

A:一直报这个type error,调试了好一阵,最后在tof上看到网友说connect方法不能只传 mapdispatchtoprops这个参数

connect(mapstatetoprops,mapdispatchtoprops)(CitySelector)才正确

R:因为展示某城市的天气信息这个demo中,选择城市这个组件不需要跟踪state的更新,所以我在connect中没有传mapstatetoprops。

--2017/9/15

相关文章:

  • 2022-02-02
  • 2022-12-23
  • 2021-04-16
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
  • 2021-01-24
猜你喜欢
  • 2021-07-09
  • 2021-08-07
  • 2021-07-31
  • 2021-07-25
  • 2022-02-02
  • 2022-12-23
  • 2022-01-19
相关资源
相似解决方案