-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Revamps the Switch API with the goal of increasing the pit of success: - Introduce `trackColor` which encourages callers configuring the color to set colors for both cases. - Introduce `ios_backgroundColor` which allows customizing the iOS-only background fill color. - Deprecate `tintColor` because it is not obvious that this is for the `false` case. - Deprecate `onTintColor` because the prop is named unconventionally like a callback. - Renamed `thumbTintColor` to `thumbColor`. This revision also cleans up the `Switch` component in the following ways: - More precise Flow types for native components. - Inline iOS-specific style (so that the code gets stripped on Android). - Minor documentaiton cleanup. After this commit, all deprecated props will continue working. Next, I plan to introduce warnings. Eventually (e.g. in a couple releases), we can drop support for the deprecated props. Reviewed By: TheSavior Differential Revision: D9081343 fbshipit-source-id: c5eb949047dd7a0ffa72621839999d38e58cada8
- Loading branch information
1 parent
9f8b5a9
commit 965adee
Showing
2 changed files
with
169 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
965adee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uoh, I think tith these changes, the Android switch is out of sync :(
It would be better to change the name to SwitchIOS.