Closed X-neuron closed 4 years ago
消息报错列表:
useLocales running useLocales.jsx:27:10
effect:
Object { name: "简体中文", value: "zh-CN", icons: "🇨🇳" }
useLocales.jsx:76:12
false 2 index.jsx:12:10
useLocales running useLocales.jsx:27:10
true index.jsx:12:10
Error: "Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bchildren%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
React 9
unstable_runWithPriority scheduler.production.min.js:19
React 5
e create-model.js:48
notify container.js:24
onUpdate create-model.js:34
Executor executor.js:5
xn react-reconciler.production.min.js:60
sr react-reconciler.production.min.js:81
Yr react-reconciler.production.min.js:161
Bo react-reconciler.production.min.js:147
Ho react-reconciler.production.min.js:147
Ao react-reconciler.production.min.js:140
yt react-reconciler.production.min.js:29
unstable_runWithPriority scheduler.production.min.js:19
pt react-reconciler.production.min.js:28
yt react-reconciler.production.min.js:29
mt react-reconciler.production.min.js:28
Po react-reconciler.production.min.js:131
Bn react-reconciler.production.min.js:70
v useLocales.jsx:70
react-dom.production.min.js:209:194
React 5
unstable_runWithPriority scheduler.production.min.js:19
React 4
unstable_runWithPriority scheduler.production.min.js:19
React 5
e create-model.js:48
notify container.js:24
onUpdate create-model.js:34
Executor executor.js:5
xn react-reconciler.production.min.js:60
sr react-reconciler.production.min.js:81
Yr react-reconciler.production.min.js:161
Bo react-reconciler.production.min.js:147
Ho react-reconciler.production.min.js:147
Ao react-reconciler.production.min.js:140
yt react-reconciler.production.min.js:29
unstable_runWithPriority scheduler.production.min.js:19
pt react-reconciler.production.min.js:28
yt react-reconciler.production.min.js:29
mt react-reconciler.production.min.js:28
Po react-reconciler.production.min.js:131
Bn react-reconciler.production.min.js:70
v useLocales.jsx:70
Error: "Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bchildren%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
React 9
unstable_runWithPriority scheduler.production.min.js:19
React 5
e create-model.js:48
notify container.js:24
onUpdate create-model.js:34
Executor executor.js:5
xn react-reconciler.production.min.js:60
sr react-reconciler.production.min.js:81
Yr react-reconciler.production.min.js:161
Bo react-reconciler.production.min.js:147
Ho react-reconciler.production.min.js:147
Ao react-reconciler.production.min.js:140
yt react-reconciler.production.min.js:29
unstable_runWithPriority scheduler.production.min.js:19
pt react-reconciler.production.min.js:28
yt react-reconciler.production.min.js:29
mt react-reconciler.production.min.js:28
Po react-reconciler.production.min.js:131
Bn react-reconciler.production.min.js:70
v useLocales.jsx:70
react-reconciler.production.min.js:111:194
Mr react-reconciler.production.min.js:111
callback react-reconciler.production.min.js:127
Lt react-reconciler.production.min.js:37
Ir react-reconciler.production.min.js:114
$o react-reconciler.production.min.js:153
unstable_runWithPriority scheduler.production.min.js:19
pt react-reconciler.production.min.js:28
qo react-reconciler.production.min.js:149
Ao react-reconciler.production.min.js:140
yt react-reconciler.production.min.js:29
unstable_runWithPriority scheduler.production.min.js:19
pt react-reconciler.production.min.js:28
yt react-reconciler.production.min.js:29
mt react-reconciler.production.min.js:28
Po react-reconciler.production.min.js:131
Bn react-reconciler.production.min.js:70
v useLocales.jsx:70
Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bchildren%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings. react-dom.production.min.js:139:46
这里 return {children}
有问题的吧?我理解你的场景应该是 return children
?这个报错应该是你的组件里逻辑出错了~
改 成children 逻辑OK 了。学习了,十分 感谢!
以下代码场景:主要实现 语言包加载完成后,在加载主界面,但主界面构建失败(其他组件都使用const {intl} = useLocaleModel()来国际化)。提示可能是出现内部的循环归调用失败..
如直接显示主界面,再切换语言则正常。
暂未上react 的同步模式,目前采用useEffect,setState的方式,来解决加载后刷新的逻辑。
这个方式hox国际化的逻辑 有问题么,还是这种内部订阅方式导致的问题 ??
useLocales: