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

[TS2503] Should we override Animated to be a TS namespace? #11

Closed
alloy opened this issue Dec 10, 2020 · 4 comments
Closed

[TS2503] Should we override Animated to be a TS namespace? #11

alloy opened this issue Dec 10, 2020 · 4 comments
Labels
question Further information is requested
Milestone

Comments

@alloy
Copy link
Member

alloy commented Dec 10, 2020

Currently in DT Animated is defined as a namespace, whereas it's a plain object in the Flow types.

import { Animated } from "react-native"
const value: Animated.Value = new Animated.Value(42)
@alloy alloy added the question Further information is requested label Dec 10, 2020
@alloy
Copy link
Member Author

alloy commented Dec 10, 2020

I’m on the fence as to what to do here.

@alloy
Copy link
Member Author

alloy commented Jan 5, 2021

I recall that @TheSavior previously had mentioned that RN core is open to accepting patches to change code to use ES6 syntax, but that they simply hadn’t had a strong need to do so yet. Perhaps the Animated APIs would be a good case to change upstream so that we don’t need to do any real conversions, but that means that for the time being we should perform that change in the TS typings with an override.

@alloy alloy added this to the v1 milestone Jan 5, 2021
@TheSavior
Copy link

What would you propose the change to the upstream code looks like?

@alloy
Copy link
Member Author

alloy commented Jan 31, 2021

I decided to fix it in TS instead, seeing as namespaces are a TS only thing. d385982

@alloy alloy closed this as completed Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants