Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Provide a working example of <image source={require(...)}> please #7

Closed
jkoutavas opened this issue Jan 18, 2021 · 2 comments
Closed

Comments

@jkoutavas
Copy link

jkoutavas commented Jan 18, 2021

Can someone please provide a working example of using static images for <image>? I'm unable to succeed with what's covered in react-native-web issue #1497 as a solution for this request. Thank you so much.

@jkoutavas
Copy link
Author

I've simplified the problem down by building a minimal javascript example app, not using create-react-native-web-application. So, I'm ruling out its an issue with your fine template, nor is it somehow TypeScript/webpack related.

Example app is here, if you're interested: https://github.com/jkoutavas/react-native-web-static-image

@RichardLindhout
Copy link
Member

Require should work fine but you can also import on top like described in create-react-app. You should not add anything it should work out of the box.

But React Native Web image required to have width/height specified

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

No branches or pull requests

2 participants