question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with `concat` typescript typing

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
wcandilloncommented, Jun 3, 2019

This fix is not shipped in 1.0.1 unfortunately. It should be available in the next release. I would suggest closing this issue.

0reactions
samiedecommented, Dec 6, 2019

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found