TypeScript types taken as literals
See original GitHub issueType definitions are a little weird. I’m having TS get angry with Animated Values. When I pass a number as a Value, it takes it as a literal. Current workaround is to pass a number with <number>
to force the type. Otherwise, it will take my 0
or whatever else I pass it as the type, literally.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Documentation - Template Literal Types - TypeScript
Template literal types build on string literal types, and have the ability to expand into many strings via unions. They have the same...
Read more >What are string literal types in TypeScript ? - GeeksforGeeks
String literal types work well with union types and type aliases in practice. These properties can be combined to give strings enum-like ...
Read more >TypeScript: Template Literal Types - Michal Zalecki
Literal types in TypeScript allow for narrowing down the type to the exact value. You can communicate in the type system that the...
Read more >String Literal Types in TypeScript - Marius Schulz
With TypeScript 1.8, string literal types made their way into the language. The pull request in which they're implemented summarizes them as ...
Read more >TypeScript String Literal Types
A TypeScript string literal type defines a type that accepts specified string literal. · Use the string literal types with union types and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Very weird. I have always passed the type parameter so never seen this issue.
Changing the definitions to something like this seems to work:
NOTE: probably should be done in the
Adaptable
class instead of here.Looks super ugly though.
Hey, I’m sorry for the late response 😔
I think this issue may be outdated now, so I’m closing it.
If you still face the same problem feel free to reopen