Skip to content

Commit

Permalink
Merge pull request #590 from Shopify/fix/useFont-remove-unused-code-path
Browse files Browse the repository at this point in the history
Removed unused code path from useFont
  • Loading branch information
chrfalch authored Jun 14, 2022
2 parents b61b364 + 97bdc4c commit 94eac28
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions package/src/skia/core/Font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ export const useFont = (
): SkFont | null => {
const typeface = useTypeface(font, onError);
return useMemo(() => {
if (typeface === null) {
return null;
} else if (typeface && size) {
if (typeface && size) {
return Skia.Font(typeface, size);
} else if (typeface && !size) {
return Skia.Font(typeface);
} else {
return Skia.Font();
return null;
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [typeface]);
Expand Down

0 comments on commit 94eac28

Please sign in to comment.