gluestack / gluestack-ui

React & React Native Components & Patterns (copy-paste components & patterns crafted with Tailwind CSS (NativeWind))
https://gluestack.io/
MIT License
2.39k stars 115 forks source link

tintColor prop on image doesn't accept tokens #1978

Open lhguerra opened 6 months ago

lhguerra commented 6 months ago

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

Other Platform

No response

Additional Information

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

lhguerra commented 6 months ago

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 commented 5 months ago

@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 commented 5 months ago

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

surajahmed commented 5 months ago

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