This commit is contained in:
Zoe Roux
2022-11-29 17:54:51 +09:00
parent ef0f0e7654
commit bde4f8b4c3
5 changed files with 7 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
import * as Font from "expo-font";
import React from "react";
import { Text, } from "react-native";
import { Text, Platform, } from "react-native";
import createIconSet from "./vendor/react-native-vector-icons/lib/create-icon-set";
import createIconButtonComponent from "./vendor/react-native-vector-icons/lib/icon-button";
export { DEFAULT_ICON_COLOR, DEFAULT_ICON_SIZE, } from "./vendor/react-native-vector-icons/lib/create-icon-set";
@@ -35,7 +35,7 @@ export default function (glyphMap, fontName, expoAssetId, fontStyle) {
if (__DEV__ && this.props.name && !(this.props.name in glyphMap)) {
console.warn(`"${this.props.name}" is not a valid icon name for family "${fontName}"`);
}
if (!this.state.fontIsLoaded) {
if (Platform.OS !== "web" && !this.state.fontIsLoaded) {
return <Text />;
}
return (<RNVIconComponent ref={(view) => {

File diff suppressed because one or more lines are too long

View File

@@ -8,6 +8,7 @@ import {
OpaqueColorValue,
TextStyle,
ViewStyle,
Platform,
} from "react-native";
import createIconSet from "./vendor/react-native-vector-icons/lib/create-icon-set";
@@ -150,7 +151,7 @@ export default function <G extends string, FN extends string>(
);
}
if (!this.state.fontIsLoaded) {
if (Platform.OS !== "web" && !this.state.fontIsLoaded) {
return <Text />;
}

View File

@@ -5,7 +5,7 @@
"build": "expo build:web"
},
"dependencies": {
"@expo/vector-icons": "13.0.0",
"@expo/vector-icons": "../",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/native": "^5.2.4",
"@react-navigation/stack": "^5.2.19",

View File

@@ -2035,10 +2035,8 @@
dependencies:
cross-spawn "^6.0.5"
"@expo/vector-icons@13.0.0":
"@expo/vector-icons@../":
version "13.0.0"
resolved "https://registry.yarnpkg.com/@expo/vector-icons/-/vector-icons-13.0.0.tgz#e2989b85e95a82bce216f88cf8fb583ab050ec95"
integrity sha512-TI+l71+5aSKnShYclFa14Kum+hQMZ86b95SH6tQUG3qZEmLTarvWpKwqtTwQKqvlJSJrpFiSFu3eCuZokY6zWA==
"@expo/vector-icons@^12.0.4":
version "12.0.5"