File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,12 @@ export type ImageProps = RNImageProps &
78
78
* An imageId that can be used in sourceTransformer logic
79
79
*/
80
80
imageId ?: string ;
81
+ /**
82
+ * Use a container for the Image, this can solve issues on
83
+ * Android when animation needs to be performed on the same
84
+ * view; i.e. animation related crashes on Android.
85
+ */
86
+ useBackgroundContainer ?: boolean ;
81
87
} ;
82
88
83
89
type Props = ImageProps & ForwardRefInjectedProps & BaseComponentInjectedProps ;
@@ -176,7 +182,7 @@ class Image extends PureComponent<Props, State> {
176
182
return < SvgImage data = { source } { ...others } /> ;
177
183
} ;
178
184
179
- renderErrorImage = ( ) => {
185
+ renderImageWithContainer = ( ) => {
180
186
const { style, cover, modifiers} = this . props ;
181
187
const { margins} = modifiers ;
182
188
@@ -241,8 +247,9 @@ class Image extends PureComponent<Props, State> {
241
247
242
248
renderRegularImage ( ) {
243
249
const { error} = this . state ;
244
- if ( error ) {
245
- return this . renderErrorImage ( ) ;
250
+ const { useBackgroundContainer} = this . props ;
251
+ if ( error || useBackgroundContainer ) {
252
+ return this . renderImageWithContainer ( ) ;
246
253
} else {
247
254
return this . renderImage ( false ) ;
248
255
}
You can’t perform that action at this time.
0 commit comments