Skip to content

Commit a21612d

Browse files
authored
SvgImage - remove tintColor to fix Android crash (#1903)
* SvgImage - remove tintColor to fix Android crash * Rename * Add comment
1 parent 04eff75 commit a21612d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

generatedTypes/src/components/svgImage/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/// <reference types="react" />
22
export interface SvgImageProps {
3+
/**
4+
* the asset tint
5+
*/
6+
tintColor?: string | null;
37
data: any;
48
}
59
declare function SvgImage(props: SvgImageProps): JSX.Element | null;

src/components/svgImage/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@ const SvgCssUri = SvgPackage?.SvgCssUri;
66
// const SvgProps = SvgPackage?.SvgProps; TODO: not sure how (or if) we can use their props
77

88
export interface SvgImageProps {
9+
/**
10+
* the asset tint
11+
*/
12+
tintColor?: string | null;
913
data: any; // TODO: I thought this should be string | React.ReactNode but it doesn't work properly
1014
}
1115

1216
function SvgImage(props: SvgImageProps) {
13-
const {data, ...others} = props;
17+
// tintColor crashes Android, so we're removing this until we properly support it.
18+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
19+
const {data, tintColor, ...others} = props;
1420

1521
if (!SvgXml) {
1622
// eslint-disable-next-line max-len

0 commit comments

Comments
 (0)