AntDesign(React)学习-13 Warning XX should not be prefixed with namespace XXX

有篇UMI入门简易教程可以看看:https://www.yuque.com/umijs/umi/hello

程序在点击操作时报了一个Warning: [sagaEffects.put] User/updateUserState should not be prefixed with namespace User,但不影响正常使用。

解决方法

1、最开始以为是页面下的dispatch不需要加User/但去掉后没反应了

2、尝试在页面下增加如下代码屏蔽警告,可以,但是感觉不是最终解决方法

console.error = message => {
  if (message.indexOf("prefixNamespace") === -1) {
    console.log(message);
  }
};

3、最后发现出错地方是model 下reducer同文件下effects的一个多了User/,去掉即可

原文地址:https://www.cnblogs.com/zhaogaojian/p/12286900.html