Closed PedroAugustoRamalhoDuarte closed 2 weeks ago
If you're using Vite then it'll use the ESM version of Heroicons which from my testing doesn't have problems tree shaking even without the pure annotation on React.forwardRef(…)
.
Having said that, we should add the annotation anyway as React.forwardRef
doesn't have side effects and it could help other build tools.
@thecrypticace thanks for the PR
Hello, thanks for this library!!
The problem
I am building a component library on top of heroicons and headlessui, but I am having some problem to make my component library tree-shakable. The components that using heroicons are not tree-shakable.
I am using this tool (agadoo) to check tree-shakable config, but I am not sure if we can trust 100% in it.
I saw in the source code that you guys annotate the with PURE annotations, but when I run agadoo with this component its fails
The fix
The fix, it's only add one more pure annotation in forwardRef function call.