From edf30065ea3544611af66c5319f47e46ee31b721 Mon Sep 17 00:00:00 2001 From: Oleg Lokhvitsky Date: Wed, 13 Jan 2016 11:46:26 -0800 Subject: [PATCH] Add details about undoing require() image sizing It can be overridden with undefined to scale dynamically --- docs/Images.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/Images.md b/docs/Images.md index 4dad3998a445..12ab24fe2fdf 100644 --- a/docs/Images.md +++ b/docs/Images.md @@ -60,6 +60,8 @@ var icon = this.props.active ? require('./my-icon-active.png') : require('./my-i ``` +Note that image sources required this way include size (width, height) info for the Image. If you need to scale the image dynamically (i.e. via flex), you may need to manually set { width: undefined, height: undefined } on the style attribute. + **Available React Native 0.14+**. If you've generated your project with 0.13 or earlier, read this. The new asset system relies on build hooks for [Xcode](https://github.com/facebook/react-native/pull/3523) and [Gradle](https://github.com/facebook/react-native/commit/9dc036d2b99e6233297c55a3490bfc308e34e75f) that are included in new projects generated with `react-native init`. If you generated your projects before that, you'll have to manually add them to your projects to use the new images asset system. See [Upgrading](/react-native/docs/upgrading.html) for instructions on how to do this. ## Images From Hybrid App's Resources