The Wayback Machine - https://web.archive.org/web/20200524115037/https://github.com/wix/react-native-navigation/issues/6099
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

[v6][Types] Icon type does not accept object #6099

Open
safaiyeh opened this issue Apr 2, 2020 · 4 comments
Open

[v6][Types] Icon type does not accept object #6099

safaiyeh opened this issue Apr 2, 2020 · 4 comments

Comments

@safaiyeh
Copy link
Contributor

@safaiyeh safaiyeh commented Apr 2, 2020

Issue Description

Icon can accept an object with different attributes

Steps to Reproduce / Code Snippets / Screenshots

icon: {
  uri: '...',
  scale: 5
}

TypeScript Error

Type '{ uri: string; scale: number; }' is not assignable to type 'string | number | undefined'.
  Type '{ uri: string; scale: number; }' is not assignable to type 'number'.

Environment

  • React Native Navigation version: ^6.4.0
  • React Native version: 0.62.0
  • Platform(s) (iOS, Android, or both?): both
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator/Debug
@guyca
Copy link
Collaborator

@guyca guyca commented Apr 5, 2020

Hey @safaiyeh 👋
Seems like you're referring to ImageURISource while RNN uses ImageRequireSource which is the result of requiring an image.

Should we be using ImageURISource?

@safaiyeh
Copy link
Contributor Author

@safaiyeh safaiyeh commented Apr 5, 2020

I believe so. The properties I defined take effect, should be reflected in the type.

@guyca
Copy link
Collaborator

@guyca guyca commented Apr 6, 2020

Oh actually you're probably referring to ImageResolvedAssetSource which is the result of Image.resolveAssetSource(value) where value is of type ImageRequireSource.

@safaiyeh Want to submit a PR? It's probably a small change to processImage

@safaiyeh
Copy link
Contributor Author

@safaiyeh safaiyeh commented Apr 6, 2020

Sure! I can check it out tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.