mirror of
https://github.com/zoriya/expo-vector-icons.git
synced 2026-06-06 20:02:30 +00:00
Add SSR support (see expo/vector-icons#193)
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user