You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all: The new monorepo changes are great!
I'm working on a react-native app which contains a component that accepts the icon name as props and renders the icon.
There is currently no exported type for the icon name.
Describe the solution you'd like
I would like the icon name type to be exported in order for my prop to be properly typed to avoid passing invalid values for given icon set.
The corresponding types for the icon name already exist.
Describe alternatives you've considered
My current solution is to use patch-package to add the export of these types.
Additional context
I was wondering if I'm missing something and this is currently possible.
Otherwise, I think this would be beneficial as a feature, since I don't think this is an edge case.
import { ComponentProps } from "react";
import Icon from "@react-native-vector-icons/fontawesome6";
type Props = ComponentProps<typeof Icon>;
export type SolidIconName = Props["name"];
I believe this would work great for other fonts than fontawesome and i would prefer this over a patch file for maintainabilty reasons.
For fontawesome this does not work, as it shows types are incompatible.
I believe the reason for this is, that fontawesome is providing multiple styles ("solid", "regular", etc.)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
First of all: The new monorepo changes are great!
I'm working on a react-native app which contains a component that accepts the icon name as props and renders the icon.
There is currently no exported type for the icon name.
Describe the solution you'd like
I would like the icon name type to be exported in order for my prop to be properly typed to avoid passing invalid values for given icon set.
The corresponding types for the icon name already exist.
Describe alternatives you've considered
My current solution is to use patch-package to add the export of these types.
Additional context
I was wondering if I'm missing something and this is currently possible.
Otherwise, I think this would be beneficial as a feature, since I don't think this is an edge case.
Here's my code:
package.json:
Component:
My changes to
@react-native-vector-icons/fontawesome6/lib/typescript/module/src/index.d.ts
:EDIT:
I found this comment
which proposes
I believe this would work great for other fonts than fontawesome and i would prefer this over a patch file for maintainabilty reasons.
For fontawesome this does not work, as it shows
types are incompatible.
I believe the reason for this is, that fontawesome is providing multiple styles ("solid", "regular", etc.)
The text was updated successfully, but these errors were encountered: