Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import createIconSet from 'react-native-vector-icons/lib/create-icon-set';
import glyphMap from './iconfont.json';
// glyphMap, fontFamily, fontFile三个参数,注意看react-native-vector-icons官方文档中方法注释,
// Android中fontFamily可以随便写,iOS必须是正确的名字否则运行报错,iOS可以直接双击iconfont.ttf打开看字体实际叫什么名字
const iconSet = createIconSet(glyphMap, 'iconFont', 'iconfont.ttf');
export default iconSet;
export const Button = iconSet.Button;
export const TabBarItem = iconSet.TabBarItem;
export const TabBarItemIOS = iconSet.TabBarItemIOS;
export const ToolbarAndroid = iconSet.ToolbarAndroid;
export const getImageSource = iconSet.getImageSource;
/**
* Created by Rabbit on 2018/4/13.
*/
import createIconSet from 'react-native-vector-icons/lib/create-icon-set';
import glyphMap from './iconfont';
const CustomIcon = createIconSet(glyphMap, 'iconfont', 'iconfont.ttf');
export default CustomIcon;
*/
'use strict';
import createIconSet from 'react-native-vector-icons/lib/create-icon-set';
import {
GLYPH_MAP,
FONT_NAME,
FONT_FILE
} from './config'
/**
* Icon Component
* @example
*
*/
export default class Icon extends createIconSet(GLYPH_MAP, FONT_NAME, FONT_FILE) {
/**
* @param {object} prop
* @param {string} prop.name - Icon name
* @param {number} [prop.size=12] - Icon size
* @param {string} [prop.color] - Icon color
*/
constructor(props) {
super(props);
}
}