[RN] Fix "Error: Provided an image that is available locally already."
This commit is contained in:
parent
18d677e2f5
commit
78bc8121ff
|
@ -1,6 +1,6 @@
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { View } from 'react-native';
|
import { Image, View } from 'react-native';
|
||||||
|
|
||||||
import { CachedImage, ImageCache } from '../../../mobile/image-cache';
|
import { CachedImage, ImageCache } from '../../../mobile/image-cache';
|
||||||
import { Platform } from '../../react';
|
import { Platform } from '../../react';
|
||||||
|
@ -263,13 +263,19 @@ export default class Avatar extends Component {
|
||||||
imageStyle = style;
|
imageStyle = style;
|
||||||
}
|
}
|
||||||
|
|
||||||
let element = React.createElement(CachedImage, {
|
let element
|
||||||
...props,
|
= React.createElement(
|
||||||
|
|
||||||
resizeMode: 'contain',
|
// XXX CachedImage removed support for images which clearly do
|
||||||
source,
|
// not need caching.
|
||||||
style: imageStyle
|
typeof source === 'number' ? Image : CachedImage,
|
||||||
});
|
{
|
||||||
|
...props,
|
||||||
|
|
||||||
|
resizeMode: 'contain',
|
||||||
|
source,
|
||||||
|
style: imageStyle
|
||||||
|
});
|
||||||
|
|
||||||
if (viewStyle) {
|
if (viewStyle) {
|
||||||
element = React.createElement(View, { style: viewStyle }, element);
|
element = React.createElement(View, { style: viewStyle }, element);
|
||||||
|
|
Loading…
Reference in New Issue