gluestack / gluestack-ui

React & React Native Components & Patterns (copy-paste components & patterns crafted with Tailwind CSS (NativeWind))

Home Page:https://gluestack.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switch activeThumbColor type error

sdfricke opened this issue · comments

Description

There is a type error when trying to use activeThumbColor prop with Switch component

CodeSandbox/Snack link

No response

Steps to reproduce

When trying to utilize the Switch component from @gluestack-ui/themed I get a type error when using the activeThumbColor prop: Property 'activeThumbColor' does not exist on type 'IntrinsicAttributes & StyledComponentProps<StyleProp, unknown, SwitchProps, "Switch"> & RefAttributes<...> & IInterfaceSwitchProps'. The prop works as expected however. I converted onTrackColor prop to this prop based on the migration guide. Thank you for any help you can provide.

gluestack-ui Version

1.1.22

Platform

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

Other Platform

No response

Additional Information

No response

@sdfricke Thanks for reporting this. We'll have a look.

Hey @sdfricke, this is an expected type error as "activeThumbColor" prop is currently not supported on react-native's Switch component.
This prop is only supported on react-native-web and would work fine on the web.

Closing this issue for now, feel free to reopen it if you face any problems.

@DaminiPandey thank you for getting back to me. I'm confused as to why that prop is recommended to use in the migration guide: https://geekyants.notion.site/Switch-96202d04cd3a45edb5a0c3fa1978d75e as a replacement for onThumbColor which was the prop in the native-base Switch