小编Adr*_*dri的帖子

React i18n - “t”函数不接受字符串变量(打字稿)?“没有与此调用匹配的过载”

任何熟悉此错误的人:[带有错误消息的代码][1] [1]:https://i.stack.imgur.com/SbJvu.png

{t(`${settingType}` as const)}
Run Code Online (Sandbox Code Playgroud)

错误:

No overload matches this call.
  Overload 1 of 2, '(key: TemplateStringsArray | Normalize<{
Run Code Online (Sandbox Code Playgroud)

谢谢 :)

typescript i18next react-i18next react-typescript

3
推荐指数
1
解决办法
3454
查看次数