Skip to content

Type error on template literal with expression on Typescript 4.2 #1319

Closed
@elgorditosalsero

Description

@elgorditosalsero

🐛 Bug Report

On Typescript 4.2.x the typed t function throw a type error when using template literal with an expression.
The doc says that's handled by TS 4.2.x and the workaround of as const is required only in TS 4.1.

ts

To Reproduce

  1. Follow the guide for TS support on a project with TS 4.2.x.
  2. Use an expression inside the t function with a template literal
t(`activities:bottomSheets.assumption.title.${activity._type}`)

Expected behavior

TS should not throw the error :)

Your Environment

  • runtime version: Node 15.13.0, React Native 0.64, TS 4.2.4
  • i18next version: 20.2.2
  • os: Mac

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions