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

React-Native image element doesn't seem to be functional #6

Closed
Johnnybar opened this issue Nov 22, 2018 · 5 comments
Closed

React-Native image element doesn't seem to be functional #6

Johnnybar opened this issue Nov 22, 2018 · 5 comments

Comments

@Johnnybar
Copy link

Hi,
Thank you for creating this plugin, it's really helpful and all seems to be running smoothly.
Using the Image element with the source prop, however, doesn't seem to be working. Is this a known bug or an issue on my end?

In the example below, 'Hello' will render but Image will not:
<View> <Text>Hello</Text> <Image style={styles.heroImage} source ={require('../assets/Logo.png')}/> </View>

@slorber
Copy link
Owner

slorber commented Nov 22, 2018

Hi,
Great to see it works fine for you

Honnestly I don't know, I'm not really using this plugin currently and never tried with an image.

But I think Webpack and Metro don't manage requires the same way. With Metro you get {uri: "imageUri.jpg"} while in Webpack you get "imageUri.jpg" directly. You should rather handle resource requires at the edge of your system, and use a Provider to inject the urls/sources of your app, or something. Not sure exactly how images should be managed in a cross platform way

@Johnnybar
Copy link
Author

Ok, thanks for your reply. I'll see if I can resolve this that way

@slorber
Copy link
Owner

slorber commented Nov 23, 2018

@Johnnybar you are using 2.0 alpha? Someone here seems to report it does not work well for him :( #7

@Johnnybar
Copy link
Author

I am, and I did have problems with the react next plugin, but once I removed it, all worked fine for me. Images are also loading fine. Stack Navigator doesn't seem to be functional though

@slorber
Copy link
Owner

slorber commented Jan 25, 2020

I have this PR with a site running on v3 beta6 and there are images, seems to work.

expo/examples#39

@slorber slorber closed this as completed Jan 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants