You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
While updating to 2.5.0 (2.4.2 works fine), I encountered some warnings on the console while using withI18n. In essence, it seems that the i18n property is not defined while creating the initial component. The output is as follows:
Warning: Failed prop type: The prop `i18n` is marked as required in `HeadTitle`, but its value is `undefined`.
in HeadTitle (created by WithI18n)
in WithI18n (created by PageContent)
...
in I18nProvider (created by App)
...
Funnily enough, when I make HeadTitle a class, and inspect the properties in the constructor, everything is there. So no idea when the prop types are checked, or put differently - why or when the warnings are given in the first place.
To Reproduce
The following code suffices. Note that this is a slimmed down version of the actual component. I am aware of the new <I18n> component of 2.5.0.
Note, if withI18n receives something "wrapped" (for lack of a better term), no warnings are given. For example, the following code works fine (that is, no warnings).
export default withI18n()(withCookies(HeadTitle))
(withCookies is used for an example, but anything will do, e.g. redux).
Expected behavior
No warnings are logged ;-)
Additional context
I suspect the change to withI18n.js in this commit is the culprit. But this is just a hunch.
The text was updated successfully, but these errors were encountered:
Describe the bug
While updating to 2.5.0 (2.4.2 works fine), I encountered some warnings on the console while using
withI18n
. In essence, it seems that thei18n
property is not defined while creating the initial component. The output is as follows:Funnily enough, when I make
HeadTitle
a class, and inspect the properties in the constructor, everything is there. So no idea when the prop types are checked, or put differently - why or when the warnings are given in the first place.To Reproduce
The following code suffices. Note that this is a slimmed down version of the actual component. I am aware of the new
<I18n>
component of 2.5.0.Note, if
withI18n
receives something "wrapped" (for lack of a better term), no warnings are given. For example, the following code works fine (that is, no warnings).(withCookies is used for an example, but anything will do, e.g. redux).
Expected behavior
No warnings are logged ;-)
Additional context
I suspect the change to
withI18n.js
in this commit is the culprit. But this is just a hunch.The text was updated successfully, but these errors were encountered: