Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Trying to create custom icon set in react-native(expo) but getting a TypeError in TypeScript

$
0
0

I am trying to create my own Icon set in react native, but struggling with the types.Here is my code for Percolate.tsx file.

import React, {FC} from 'react';import { createIconSet } from '@expo/vector-icons';const glyphMap = {...};const IconSet = createIconSet(glyphMap, 'percolate', '../assets/icon/percolate.ttf');interface IIconSetProps { name: keyof typeof glyphMap, color: string, size?: number, style: object,}const PercolateIcons: FC<IIconSetProps> = ({name, color, size, style}) => {    return <IconSet name={name} color={color} size={size} style={style}></IconSet>}export default PercolateIcons;export const Button = IconSet.Button;

Here is the error I am getting.enter image description here


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>