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

Strongly type name property #32

Open
rdjpalmer opened this issue Jul 31, 2022 · 0 comments
Open

Strongly type name property #32

rdjpalmer opened this issue Jul 31, 2022 · 0 comments

Comments

@rdjpalmer
Copy link

Description

Comparing the FontAwesome icon set which ships with Expo to this project, we lose all typing on the name property for the icon component. It would be particularly helpful during development to ensure the names are correct without having to look them up.

From what I can tell, it could be as simple as the following change, but I'd to confirm before making a PR:

diff --git a/index.d.ts b/index.d.ts
index 7bb654d..7a3b969 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -1,8 +1,9 @@
+import { IconName } from "@fortawesome/fontawesome-svg-core";
 import { ViewStyle, ViewProps } from "react-native";
 import { SvgProps } from "react-native-svg";
 
 export interface IconProps extends ViewProps {
-  name?: string;
+  name?: IconName;
   size?: number;
   color?: string;
   type?: "regular" | "light" | "solid" | "brands";

Environment

  • What react-native-fontawesome-pro version are you using? Latest
  • What react-native version are you using? N/A
  • Does the issue occur on IOS, Android or Both? N/A
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