mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-07 16:54:52 +00:00
fix: #1262 support single dimension + aspectRatio syntax
This commit is contained in:
@@ -116,10 +116,10 @@ export default class Svg extends Shape<
|
||||
...(Array.isArray(style) ? Object.assign({}, ...style) : style),
|
||||
...extracted,
|
||||
};
|
||||
const {
|
||||
let {
|
||||
color,
|
||||
width = '100%',
|
||||
height = '100%',
|
||||
width,
|
||||
height,
|
||||
focusable,
|
||||
|
||||
// Inherited G properties
|
||||
@@ -137,6 +137,9 @@ export default class Svg extends Shape<
|
||||
strokeLinejoin,
|
||||
strokeMiterlimit,
|
||||
} = stylesAndProps;
|
||||
if (width === undefined && height === undefined) {
|
||||
width = height = '100%';
|
||||
}
|
||||
|
||||
const props: extractedProps = extracted as extractedProps;
|
||||
props.focusable = Boolean(focusable) && focusable !== 'false';
|
||||
|
||||
Reference in New Issue
Block a user