New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Next.js - Prop className
did not match.
#817
Comments
className
did not match.
Dear , I'm Anuj Varshney, experienced in resolving such issues efficiently. Kindly assign it to me. I'll work diligently and keep you updated. Excited to contribute. |
found a work around for this, in typescript it wont even allow the provider to exist, so just added a span whit the classes I need <span className="text-red-500 text-9xl">
<FaHotTub />
</span> |
Yeah.... Adding this to every instance of an icon component is not practical and pretty much defeats the purpose of the className prop and icon context 😔 |
@bombillazo I know, was pretty confused when I couldn't even use the IconContext, hope this helps someone tho |
@Hachikoi-the-creator I have a solution for this, though 😄 @kamijin-fanta Remember my PR #720 ? This issue is solved by allowing users to wrap icons with custom elements (like span in this case) to solve the issue caused by Next.js + React Icons. So it seems we have another use case for the PR. |
Adding const nextConfig = {
transpilePackages: ["react-icons"]
}; |
Thanks @loczek , that worked! |
Describe the bug
When using this lbrary and adding a class name to icons using the IconContext.Provider:
We get the following error on page load:
Expected behavior
No error is given.
Minimal sample repository URL
N/A
Steps To Reproduce
Package version
v4.11.0
Relevant log output
Additional context
No response
The text was updated successfully, but these errors were encountered: