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
The translate function is typed to always return a string, which is incorrect. In the case of a partial path, it will return an object instead, as seen here.
Thus, code that uses and expects that functionality will not even compile in Typescript because of a type mismatch.
Example:
setTranslations({foo: "bar",baz: {foo: "bar"}})constbaz=t("baz")// returns { foo: "bar" }Object.assign(baz,fallback: "")// will bomb because of the incorrect type signature of translate
The text was updated successfully, but these errors were encountered:
The translate function is typed to always return a string, which is incorrect. In the case of a partial path, it will return an object instead, as seen here.
Thus, code that uses and expects that functionality will not even compile in Typescript because of a type mismatch.
Example:
The text was updated successfully, but these errors were encountered: