Skip to content
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

tintColor prop on image doesn't accept tokens #1978

Open
1 of 6 tasks
lhguerra opened this issue Mar 19, 2024 · 4 comments · Fixed by #2020
Open
1 of 6 tasks

tintColor prop on image doesn't accept tokens #1978

lhguerra opened this issue Mar 19, 2024 · 4 comments · Fixed by #2020
Assignees
Labels
bug Something isn't working

Comments

@lhguerra
Copy link

Description

When i set a tint color with a color token I get invalid value error

CodeSandbox/Snack link

No response

Steps to reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

gluestack-ui Version

1.1.17

Platform

  • Expo
  • React Native CLI
  • Next
  • Web
  • Android
  • iOS

Other Platform

No response

Additional Information

ERROR Warning: Failed prop type: Invalid prop tintColor supplied to Image: $white.default
Valid color formats are

@lhguerra lhguerra added the bug Something isn't working label Mar 19, 2024
@lhguerra
Copy link
Author

lhguerra commented Mar 20, 2024

I also don't know how to reset its value, no matter what I pass (like null or an empty string) gives me the invalid color error. We should be able to unset such value! Like this tintColor={reactionStatus === ReactionType.dislike ? "#D33030" : ""}

@surajahmed
Copy link
Contributor

@lhguerra You can use useToken hook available in @gluestack-ui/themed. With this hook, you can access the token value, which can then be passed to the respective prop. For more details, follow this link https://gluestack.io/ui/docs/hooks/use-token

@lhguerra
Copy link
Author

I know that, but why would I need to do that using a Gluestack component?

@surajahmed
Copy link
Contributor

tintColor prop resolution is not supported by default in gluestack-ui. We'll add it in the future. Thanks for pointing this out.

@Viraj-10 Viraj-10 self-assigned this Apr 2, 2024
@Viraj-10 Viraj-10 linked a pull request Apr 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants