microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.4k stars 2.72k forks source link

[Bug]: After version 9.54.1, bundleIcon required additional parameter to create composite icon!!!!! #31729

Closed pradeept95 closed 2 months ago

pradeept95 commented 3 months ago

Library

React Components / v9 (@fluentui/react-components)

System Info

NA

Are you reporting Accessibility issue?

no

Reproduction

https://stackblitz.com/run?file=src%2Fexample.tsx

Bug Description

Actual Behavior

after V9.54.1, the bundleIcon added one more prams while creating composite icon called "LightIcon" which causing all application incompatible with v9.54.1 and above.

image

Expected Behavior

bundleIcon should not add more parameter without providing support for existing behavior

Logs

Expected 3 arguments, but got 2.(2554)
bundleIcon.d.ts(2, 77): An argument for 'LightIcon' was not provided.
(alias) bundleIcon(FilledIcon: FluentIcon, RegularIcon: FluentIcon, LightIcon: FluentIcon): FluentIcon
import bundleIcon

Requested priority

High

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

layershifter commented 3 months ago

Linking with https://github.com/microsoft/fluentui-system-icons/issues/727

christophepeerens commented 3 months ago

Hello,

Since not finding the Light icon, I tried to define the Regular one twice.

const EditIcon = bundleIcon(EditFilled, EditRegular, EditRegular);

<Button
    icon={<EditIcon />}
    appearance="subtle"
    aria-label={t('Edit')}
/>

But the button displays the icon twice!

techienickb commented 3 months ago

Work around for anyone with this issue, override fluent ui icons back to before this breaking change, add this to your package.json

   "overrides": {
      "@fluentui/react-icons": "2.0.243"
   },
tomi-msft commented 3 months ago

PR to revert the change: https://github.com/microsoft/fluentui-system-icons/pull/728

tomi-msft commented 2 months ago

Fixed in latest version of @fluentui/react-icons