Issue with `concat` typescript typing
See original GitHub issueHi, first of all, thanks for the great work.
Im trying to use the
concat` function to handle a rotation animation like the following:
const rotateZ = concat(rotate, 'deg');
And I’m getting this error :
const rotate: Animated.Node<number>
Argument of type 'AnimatedNode<number>' is not assignable to parameter of type 'AnimatedNode<string>'.
Type 'number' is not assignable to type 'string'.
which I think is not normal. I tried to check the ts typing from GitHub repo: https://github.com/kmagiera/react-native-reanimated/blob/5f00eb4e7197379ad43eed13232b174ff08d52a4/react-native-reanimated.d.ts#L222.
but inside my node_modules file, I Have the following typing
export function concat(
a: AnimatedNode<string>,
b: AnimatedNode<string>,
...others: AnimatedNode<string>[]
): AnimatedNode<string>;
I am running the last version: 1.0.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to make TypeScript complain about string concatenation ...
Create a type-safe variadic function to do concatenation for you. concat(...strings: string[]): string { var concatenated = ""; for (var i ...
Read more >Confusing type error message in `concat` · Issue #6594 - GitHub
So, the issue isn't simply that TypeScript isn't accepting enough input scenarios; it's that TypeScript as-is today is already type-incorrect ...
Read more >TypeScript - String concat() - Tutorialspoint
TypeScript - String concat(), This method adds two or more strings and returns a new single string.
Read more >Documentation - TypeScript 4.0
Variadic Tuple Types ... Consider a function in JavaScript called concat that takes two array or tuple types and concatenates them together to...
Read more >String.prototype.concat() - JavaScript - MDN Web Docs
If the arguments are not of the type string, they are converted to string values before concatenating. The concat() method is very similar ......
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
This fix is not shipped in 1.0.1 unfortunately. It should be available in the next release. I would suggest closing this issue.
I see. I tried using the callback like this:
useCode(() => block())
but it still did not work for me. Im ok with using Animated.Code for now 😃