react-native-vector-icons icon indicating copy to clipboard operation
react-native-vector-icons copied to clipboard

[Bug]: FontAwesome6Pro.json needs update to reflect renamed/removed icons from official Font Awesome Pro

Open Prajwaltechversant opened this issue 7 months ago • 2 comments

Which package are you using?

@react-native-vector-icons/*

What platform(s) does this occur on?

Android, iOS

What happened?

I’m using @react-native-vector-icons/fontawesome6-pro in a TypeScript React Native project. When using icon names loaded from the included FontAwesome6Pro.json glyph map as types, I encounter confusing TypeScript errors due to mismatches between the icon names in the glyph map and those expected by the package typings.

`import FontAwesomeIcon from '@react-native-vector-icons/fontawesome6-pro'; import FAIcons from '../../../../../node_modules/@react-native-vector-icons/fontawesome6-pro/glyphmaps/FontAwesome6Pro.json';

export type FontAwesomeIconName = keyof typeof FAIcons;

interface IconType { show?: boolean; name: FontAwesomeIconName; customSize?: number; }

const iconLeading: IconType = { show: true, name: '100', customSize: 10 };

<FontAwesomeIcon name={icon.name} size={icon.customSize ?? 10} />; `

type error Type '"function" | "square" | "medium" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "100" | "fill-drip" | "arrows-to-circle" | "circle-chevron-right" | "chevron-circle-right" | ... 4818 more ... | "steam-symbol"' is not assignable to type '"function" | "square" | "medium" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "fill-drip" | "arrows-to-circle" | "circle-chevron-right" | "wagon-covered" | "line-height" | ... 3795 more ... | "steam-symbol"'. Type '"100"' is not assignable to type '"function" | "square" | "medium" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "fill-drip" | "arrows-to-circle" | "circle-chevron-right" | "wagon-covered" | "line-height" | ... 3795 more ... | "steam-symbol"'.

Additional details: The glyph map includes some icon names (like "100") that do not appear in the internal typings or vice versa.

Icon renames in the official Font Awesome Pro set (e.g., search → magnifying-glass) cause further mismatches.

This inconsistency breaks TypeScript type safety and causes build issues.

Expected behavior: The package’s FontAwesome6Pro.json glyph map should be updated to reflect the latest official Font Awesome Pro icons, including renamed and removed icons.

The TypeScript typings for icon names should be fully synchronized with the glyph map keys to avoid type errors.

Ideally, an automated update process or tooling should be provided to keep these in sync as Font Awesome Pro updates.

Thanks for your work maintaining this package. I hope this feedback helps improve the DX and type safety for users.

Relevant log output


Minimal reproducible example

import FontAwesomeIcon from '@react-native-vector-icons/fontawesome6-pro'; import FAIcons from '../../../../../node_modules/@react-native-vector-icons/fontawesome6-pro/glyphmaps/FontAwesome6Pro.json';

export type FontAwesomeIconName = keyof typeof FAIcons;

interface IconType { show?: boolean; name: FontAwesomeIconName; customSize?: number; }

const iconLeading: IconType = { show: true, name: '100', customSize: 10 };

<FontAwesomeIcon name={iconLeading.name} size={iconLeading.customSize ?? 10} />;

Type '"function" | "square" | "medium" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "100" | "fill-drip" | "arrows-to-circle" | "circle-chevron-right" | "chevron-circle-right" | ... 4818 more ... | "steam-symbol"' is not assignable to type '"function" | "square" | "medium" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "fill-drip" | "arrows-to-circle" | "circle-chevron-right" | "wagon-covered" | "line-height" | ... 3795 more ... | "steam-symbol"'. Type '"100"' is not assignable to type '"function" | "square" | "medium" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "fill-drip" | "arrows-to-circle" | "circle-chevron-right" | "wagon-covered" | "line-height" | ... 3795 more ... | "steam-symbol"'.

Your computer environment

System:
  OS: macOS 14.7.5
  CPU: (8) arm64 Apple M1
  Memory: 111.08 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.11.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.2
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2025.04.14.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.24978.46.2431.13208083
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.15
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.9
    wanted: 0.76.9
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Prajwaltechversant avatar Jun 06 '25 06:06 Prajwaltechversant

@almost can you please look on this ?

Prajwaltechversant avatar Jun 06 '25 06:06 Prajwaltechversant

@Prajwaltechversant I think that the exported types may help The issue is that the types are quite complex given the iconType that can be passes. So it's not as simple as using the glyphmap file.

Can you try the new types at the next release, should be released in the next few days

johnf avatar Jun 14 '25 15:06 johnf

Hi any update on this ?

Prajwaltechversant avatar Jun 30 '25 06:06 Prajwaltechversant

I've just merged the code and will be releasing in next 24 hours

johnf avatar Jul 12 '25 13:07 johnf