react-native-fontawesome icon indicating copy to clipboard operation
react-native-fontawesome copied to clipboard

Wrong TS types.

Open jankaifer opened this issue 3 years ago • 0 comments

Hi, this module is cool. But types are a bit off.

Current types are missing icon prop (it says that Icon has same props as Text):

declare module "react-native-fontawesome" {
  import React from "react";
  import { TextProperties } from "react-native";
  export { SolidIcons, RegularIcons, BrandIcons, parseIconFromClassName } from "react-native-fontawesome/FontAwesomeIcons";
  const Icon: React.ComponentClass<TextProperties>;
  export default Icon;
}

It might be an error on my end though. Just asking for confirmation.

Workaround:

import _FontAwesome from 'react-native-fontawesome';
const FontAwesome = (_FontAwesome as unknown) as React.ComponentClass<TextProperties & {
  icon: string;
  pro: boolean;
}>;

jankaifer avatar Jul 31 '21 18:07 jankaifer