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

Switch component. thumbColor and trackColor do not work. #23570

Closed
VadimCpp opened this issue Feb 21, 2019 · 6 comments
Closed

Switch component. thumbColor and trackColor do not work. #23570

VadimCpp opened this issue Feb 21, 2019 · 6 comments
Labels
Bug Component: Switch Resolution: Locked This issue was locked by the bot.

Comments

@VadimCpp
Copy link

🐛 Bug Report

Switch component. New options thumbColor and trackColor do not work.

To Reproduce

According to documentation I use trackColor and thumbColor

            <Switch
              value={true}
              trackColor={'green'}
              thumbColor={'gray'}
            />

This removes warnings but does nothing with colors.

Okay, when I put deprecated option onTintColor and thumbTintColor back:

            <Switch
              value={true}
              onTintColor={'green'}
              thumbTintColor={'gray'}
            />

there are warnings, but colors are changed.

Expected Behavior

I expect code works well according to the docs: https://facebook.github.io/react-native/docs/switch#thumbcolor

Code Example

            <Switch
              value={true}
              trackColor={'green'}
              thumbColor={'gray'}
            />

Environment

React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (8) x64 Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Memory: 2.66 GB / 12.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.2.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.2, 25.0.2, 25.0.3, 26.0.2, 26.0.3, 27.0.0, 27.0.1, 27.0.3, 28.0.0, 28.0.2, 28.0.3
System Images: android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8
npmGlobalPackages:
react-native-cli: 2.0.1

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.58 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

@VadimCpp
Copy link
Author

VadimCpp commented Feb 21, 2019

Now it is getting more clear. I tried to npm install latest version of react-native. Then my application was not able to build and run at all!

I bet it refers to some another react-native issue.
Updating react-native modules is common pain...

@hramos
Copy link
Contributor

hramos commented Feb 21, 2019

Can you clarify what your expected behavior is? It's not clear what exactly is not working as expected. Screenshots might help.

@JKCooper2
Copy link

Track color takes an object, not a single color: https://facebook.github.io/react-native/docs/switch#trackcolor
Snack: https://snack.expo.io/@jkcooper/rn-issue-#23570---switch-track-color

@hramos
Copy link
Contributor

hramos commented Feb 24, 2019

Thanks @JKCooper2. Closing as working as expected.

@hramos hramos closed this as completed Feb 24, 2019
@VadimCpp
Copy link
Author

Track color takes an object, not a single color: https://facebook.github.io/react-native/docs/switch#trackcolor
Snack: https://snack.expo.io/@jkcooper/rn-issue-#23570---switch-track-color

Thank you. It works!

@facebook facebook locked as resolved and limited conversation to collaborators Feb 24, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: Switch Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants