有篇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/,去掉即可