How to typecast mapped string array? #160
Unanswered
angelod1as
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi! Your I'll convert this to a discussion as this is not a bug but a usage question. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I have a string array, and I map it like below:
But this gives me the Typescript error:
(see that I omitted my translations above. The content of the object is the typing of my translation file.
Is there a way to typecast that the
name
anddescription
constants are acceptable in that function? AFAIK there are no types exported, so there's nothing to typecast with.Reproduction
(The provided sandbox does not work with Typescript)
Expected behaviour
I should be able to import a type that would fit the function
Beta Was this translation helpful? Give feedback.
All reactions