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