-
Notifications
You must be signed in to change notification settings - Fork 12
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
Color prop does not render correct icon color #10
Comments
Could you try removing processColor call in the JS and see if that’s better? |
@MoOx Sure. I'll have to set the project up locally. I will try it soon. |
You can try to edit directly the file from node_modules (and if that works, use patch-package until a fix comes out) |
Found the issue, looks like we have to rename the color property. |
@birkir Thanks for looking into that. Would that bug still be a problem if I'm not defining a |
Yes, I published a new version where I changed the internal prop name for color (iconColor), the API hasn't changed. |
@birkir I'm getting the same error |
It’s normal because compiled tsx omit the React import… I warned about this, my PR fixed this… |
It's not planned as explained here... #2 (comment) |
There must be some kind of misunderstanding here. @birkir you understand that the code currently hosted on the NPM registry does not work? It throws errors when incorporated into a react native project (because it hasn't been properly compiled?). Are you currently using this in a project and it's working for you? Please advise. |
It should not be compiled. None of the RN modules I know are compiled before published. Metro handles compilation with Babel and can handle TypeScript for a while. |
Oh, 🤔 . That's surprising to me too actually, I wouldn't expect metro to break with pre-compiled code. But I admittedly have never published a library for React Native. I'm looking at the node_modules that are downloaded for @react-navigation, another library that I use, and I see that they have pre-compiled to commonjs with the same peer dependencies as this library, so I'm confused as to why it's not working. Will await @birkir's thoughts. |
@jordantomax I was able to get passed the As for the original point of this issue -- even with the renaming of |
Fixed now. |
Using version
1.0.2
, I am attempting to render an icon like so:When I do so, the icon disappears completely. The same thing happens when using
#000000
. If I use a lighter shade such as#cccccc
, The color shows up, but it is very light and has a tint of red. Certain colors seem to work properly, such aswhite
orrgba(60, 60, 67, 0.3)
, but most other colors produce unexpected results.Digging into this, I see that you're using react's
processColor
. Looking at their tests, It seems like the colors that I entered should be valid.I have set up a brand new react native project using
react-native init
, and I see the same results, so I hope this is easily reproducible.Thanks for your help!
The text was updated successfully, but these errors were encountered: