mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-06 16:32:24 +00:00
To allow only data URI as iOS does not support async image loading
This commit is contained in:
+9
-5
@@ -18,11 +18,15 @@ class Image extends Shape {
|
|||||||
height: numberProp.isRequired,
|
height: numberProp.isRequired,
|
||||||
href: PropTypes.oneOfType([
|
href: PropTypes.oneOfType([
|
||||||
PropTypes.number,
|
PropTypes.number,
|
||||||
PropTypes.shape({
|
function(props, propName, componentName) {
|
||||||
uri: PropTypes.string.isRequired,
|
if (Object.keys(props[propName]).length != 1 ||
|
||||||
width: PropTypes.number.isRequired,
|
!/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i.test(props[propName].uri)) {
|
||||||
height: PropTypes.number.isRequired
|
return new Error(
|
||||||
})
|
'Invalid prop `' + propName + '` supplied to' +
|
||||||
|
' `' + componentName + '`. Validation failed.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
]).isRequired,
|
]).isRequired,
|
||||||
preserveAspectRatio: PropTypes.string
|
preserveAspectRatio: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user