initIcon→tsx

This commit is contained in:
harukin-expo-dev-env 2024-08-20 03:49:36 +00:00
parent 5c41466920
commit 9ac41bc907

View File

@ -1,7 +1,8 @@
import React from "react"; import React from "react";
import { Ionicons, AntDesign } from "@expo/vector-icons"; import { Ionicons, AntDesign } from "@expo/vector-icons";
type name = keyof typeof Ionicons.glyphMap & keyof typeof AntDesign.glyphMap;
export const initIcon = (name, type) => { type type = "Ionicons" | "AntDesign";
export const initIcon = (name: name, type:type) => {
switch (type) { switch (type) {
case "Ionicons": case "Ionicons":
return ({ focused, color, size }) => ( return ({ focused, color, size }) => (