首页 > 解决方案 > 道具类型警告显示 `b` 而不是组件名称

问题描述

我一直在尝试prop-types在我的组件中实现更好的文档和错误处理。但是,当发出警告时,调用堆栈会包含字母来代替组件名称。

前任:

Warning: Failed prop type: The prop `type` is marked as required in `b`, but its value is `undefined`.
in b (created by b)
in b (created by withI18nextTranslation(b))
in withI18nextTranslation(b) (created by ConnectFunction)
in ConnectFunction (created by c)
in c (created by LoginLayout)
in div (created by LoginLayout)
in LoginLayout (created by c)
in c (created by b)
in Switch (created by b)
in Router (created by BrowserRouter)
in BrowserRouter (created by b)
in b
in I18nextProvider
in Provider

当然,这并不理想,因为我无法找出哪个组件存在此问题。

我的第一个想法是它与 I18next 有某种关系,但即使删除后,问题仍然存在。

任何帮助将非常感激。

编辑:可变字母是由缩小代码引起的,与任何组件无关。

标签: reactjsreact-proptypes

解决方案


推荐阅读