Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript errors in 2.5.3 [Help Wanted] #34

Open
stephenwil opened this issue Nov 6, 2017 · 4 comments
Open

TypeScript errors in 2.5.3 [Help Wanted] #34

stephenwil opened this issue Nov 6, 2017 · 4 comments
Assignees
Labels

Comments

@stephenwil
Copy link

Hi,
Using create-react-app-ts, even a very basic

or
<Anime delay={(e, i) => i * 100}
scale={[.1, .9]}>



Fails on typescript errors:
ren?: ReactNode; }> & Rea...'.
Type '{ value: any; translateX: any; translateY: any; rotate: any; scale: any; opacity: any; color: any...' is not assignable to type 'Readonly'.
Types of property 'children' are incompatible.
Type 'Element' is not assignable to type 'any[]'.
Property 'find' is missing in type 'Element'.

@alaingalvan
Copy link
Member

Thanks for reporting this @stephenwil, weird to see this, maybe somethings changed with TypeScript 2.2.1 vs 2.5.3, I'll look into it. ;)

@feather-aurelie
Copy link

any update on that issue?

@jonoirwinrsa
Copy link

@stephenwil did you ever get to the bottom of this?

@benbot benbot added the Types label Jan 2, 2020
@16abhimasani
Copy link

This worked for me to fix all type errors. Just import relevant type and manually cast. I assume this would work for entire prop obj as well.

import Anime, { AnimeValue } from 'react-anime';
...

const wiggleFrames = [
    { value: xAmp * -1 },
    { value: xAmp },
    { value: xAmp / -2 },
    { value: xAmp / 2 },
    { value: 0 }
  ] as AnimeValue[];
...

<Anime duration={325} easing="easeInOutSine" translateX={inputError ? wiggleFrames : [0, 0]}>
    {amount}
</Anime>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants