props not support style like "{width: '100%'}"
See original GitHub issueimport Image from 'react-native-fast-image';
//some code
<View style={{flex:1}}>
<Image
style={{width: '50%'}}
source={{
uri: {URI},
priority: Image.priority.normal,
}}
resizeMode={Image.resizeMode.contain}
/>
</View>
prop style={{width: '50%'}}
did not work, what should i do to let this style works?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
How to set image width to be 100% and height to be auto in ...
Image's height won't become automatically because Image component is required both width and height in style props . So you can calculate by...
Read more >width - CSS: Cascading Style Sheets - MDN Web Docs
The width CSS property sets an element's width. By default, it sets the width of the content area, but if box-sizing is set...
Read more >Layout Props - React Native
It works similarly to max-width in CSS, but in React Native you must use points or percentages. Ems and other units are not...
Read more >How To Style React Components | DigitalOcean
In this tutorial, you'll learn three different ways to style React components: plain Cascading ... Here, you gave the <h2> a width of...
Read more >How To Use Styled-Components In React - Smashing Magazine
Apart from helping you to scope styles, styled components include the ... already set a default for it with width: props.width || "100%",...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JofBigHealth Thanks for the response. I finally found out the way to do like the below, it works!
Header Appreciate the response and apologize for not responding in time. i will close this issue Thanks again.
I found a similar fix to @lpaz010, like this:
It works like react-native-scalable-image, which I was using before fast-image. Send the width you want in the props of the component, e.g. device width.