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
The type definitions for FontAwesome5 and FontAwesome6 are declared as any, whereas the type definitions for other icon components (such as Octicons) use the Icon<G, FN> interface.
As it stands, a type of any eliminates type checking, IntelliSense, and developer certainty on components with an API that differs from the regular createIconSet/Icon<G, FN> component.
Expectation
The FontAwesome5 and FontAwesome6 components should have a more precise type definition, consistent with the level of precision offered elsewhere in the @expo/vector-icons library. Doing so will likely require a variant of the Icon<G, FN> interface, as it is likely not accurate for multi-style icon sets.
To Resolve
Add non-any return type to createMultiStyleIconSet (ideally with type precision consistent with the rest of the library)
The text was updated successfully, but these errors were encountered:
BellCubeDev
added a commit
to Stockedhome/stockedhome-application
that referenced
this issue
Nov 17, 2024
* Fixed icon & font rendering on native
* Code now ensures NEXT_PUBLIC_ and EXPO_PUBLIC_ ENV vars are duplicated across both names
* Createed util for getting public ENV vars
* Added asset/CDN prefix
* Fixed some type errors
* Added Dripsy-ified variants of used `@expo/vector-icons` components (also see: expo/vector-icons#317)
* Updated Solito fork to use a `'link'` variant by default for the `<TextLink>`'s child `<P>` component
* Renamed `'a'` variant to `'link'`
* Updated Solito fork to fix a mistake in Solito's typing
The Problem
The type definitions for
FontAwesome5
andFontAwesome6
are declared asany
, whereas the type definitions for other icon components (such as Octicons) use theIcon<G, FN>
interface.vector-icons/build/FontAwesome5.d.ts
Lines 7 to 8 in c897770
vector-icons/build/FontAwesome6.d.ts
Lines 12 to 13 in c897770
vector-icons/build/Octicons.d.ts
Lines 1 to 2 in c897770
This can be traced back to the function
createMultiStyleIconSet
, which has a return type ofany
:vector-icons/src/createMultiStyleIconSet.ts
Line 16 in c897770
As it stands, a type of
any
eliminates type checking, IntelliSense, and developer certainty on components with an API that differs from the regularcreateIconSet
/Icon<G, FN>
component.Expectation
The
FontAwesome5
andFontAwesome6
components should have a more precise type definition, consistent with the level of precision offered elsewhere in the@expo/vector-icons
library. Doing so will likely require a variant of theIcon<G, FN>
interface, as it is likely not accurate for multi-style icon sets.To Resolve
any
return type tocreateMultiStyleIconSet
(ideally with type precision consistent with the rest of the library)The text was updated successfully, but these errors were encountered: