Skip to content

Commit fcbd8e7

Browse files
committed
fix: align getImageSource with community package
1 parent 50f16b7 commit fcbd8e7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/createIconSet.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export interface Icon<G extends string, FN extends string> {
9696
glyphMap: GlyphMap<G>;
9797
getRawGlyphMap: () => GlyphMap<G>;
9898
getFontFamily: () => FN;
99-
getImageSource: (name: G, size: number, color: ColorValue) => Promise<string | null>;
99+
getImageSource: (name: G, size: number, color: ColorValue) => Promise<{ uri: string } | null>;
100100
loadFont: () => Promise<void>;
101101
font: { [x: string]: any };
102102
new (props: IconProps<G>): React.Component<IconProps<G>>;
@@ -129,11 +129,15 @@ export default function <G extends string, FN extends string>(
129129
return null;
130130
}
131131
await Font.loadAsync(font);
132-
return Font.renderToImageAsync(String.fromCodePoint(glyphMap[name] as number), {
133-
fontFamily: fontName,
134-
color: color as string,
135-
size,
136-
});
132+
const imagePath = await Font.renderToImageAsync(
133+
String.fromCodePoint(glyphMap[name] as number),
134+
{
135+
fontFamily: fontName,
136+
color: color as string,
137+
size,
138+
}
139+
);
140+
return { uri: imagePath };
137141
};
138142

139143
_mounted = false;

0 commit comments

Comments
 (0)