Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong TS types. #72

Open
jankaifer opened this issue Jul 31, 2021 · 0 comments
Open

Wrong TS types. #72

jankaifer opened this issue Jul 31, 2021 · 0 comments

Comments

@jankaifer
Copy link

jankaifer commented Jul 31, 2021

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;
}>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant