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
Hello there! First, thanks for this amazing icon library! ❤️
I use dependabot in my project to update the dependencies on a regular basis. Thus, without suspecting anything, I reviewed the PR that updates @heroicons/react from 1.0.5 to 1.0.6 together with its changes.
However, upgrading this dependency broke my app 😅
I relied on the types of the React package to embed heroicons and other "componentified" SVG icons into my custom Button components like this:
? `import * as React from 'react';\ndeclare function ${componentName}(props: React.ComponentProps<'svg'>): JSX.Element;\nexport default ${componentName};\n`
// propsexporttypeBaseButtonType='button'|'a';exporttypeBaseButtonProps<TextendsBaseButtonType>={as?: T;// ...icon?: (props: ComponentProps<'svg'>)=>JSX.Element;}&ComponentProps<T>;typeBaseButtonPropsWithRef<TextendsBaseButtonType>={innerRef?: ForwardedRef<Textends'button' ? HTMLButtonElement : HTMLAnchorElement>;}&BaseButtonProps<T>;constBaseButton=<TextendsBaseButtonType>({ as, children, icon, innerRef, ...props}: BaseButtonPropsWithRef<T>)=>{returncreateElement(as??'button',{
...props,ref: innerRef,},// the following line breaks the appicon?.({className: leadingIconCssClasses,'aria-hidden': 'true'}),children,);};
In #614, you introduced accessing the ref on the SVGs. However, this results in those components not being callable as a function as they are now exotic components, i.e., they are now objects of the following structure:
And this behavior is a breaking change for me which React also suggests. However, I'm aware that this might be a niche problem and maybe not relevant for most users of this library.
I now reverted the upgrade until I come up with something that allows me to upgrade to the newest version while maintaining my api's flexibility. But it would be great if you could update the typings of this package to ForwardRefExoticComponents, so that TypeScript does not compile when relying on the previously used types of this package like me.
The text was updated successfully, but these errors were encountered:
Hello there! First, thanks for this amazing icon library! ❤️
I use dependabot in my project to update the dependencies on a regular basis. Thus, without suspecting anything, I reviewed the PR that updates
@heroicons/react
from 1.0.5 to 1.0.6 together with its changes.However, upgrading this dependency broke my app 😅
I relied on the types of the React package to embed heroicons and other "componentified" SVG icons into my custom Button components like this:
heroicons/scripts/build.js
Line 96 in 71b15b9
In #614, you introduced accessing the ref on the SVGs. However, this results in those components not being callable as a function as they are now exotic components, i.e., they are now objects of the following structure:
And this behavior is a breaking change for me which React also suggests. However, I'm aware that this might be a niche problem and maybe not relevant for most users of this library.
I now reverted the upgrade until I come up with something that allows me to upgrade to the newest version while maintaining my api's flexibility. But it would be great if you could update the typings of this package to
ForwardRefExoticComponent
s, so that TypeScript does not compile when relying on the previously used types of this package like me.The text was updated successfully, but these errors were encountered: