Migrate Button component to use Pressable#4011
Migrate Button component to use Pressable#4011theianmay merged 11 commits intoreact-native-elements:nextfrom
Conversation
…Updated the fractions type to number
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #4011 +/- ##
==========================================
+ Coverage 79.26% 79.40% +0.14%
==========================================
Files 90 90
Lines 2141 2141
Branches 960 952 -8
==========================================
+ Hits 1697 1700 +3
+ Misses 442 439 -3
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey @codewithshinde! 👋 Your approach of migrating to A few things I noticed while testing1. Test for the actual bug scenarioYou might want to add a specific test that reproduces the original bug to make sure it doesn't come back: it('should switch backgroundColor when toggling disabled state', () => {
const { toJSON, rerender } = render(
<Button
title="Test"
disabled={true}
buttonStyle={{ backgroundColor: 'blue' }}
disabledStyle={{ backgroundColor: 'gray' }}
/>
);
// Start disabled (gray)
// Then re-enable and verify it switches back to blue
// This was the bug - it stayed gray on Android
});2. Link to the issueCould you add 3. The
|
|
I have added the test case requested, which toggles between disabled and enabled. Adding up to this, my changes related to fractions (#3990) are also included in this PR.
|
theianmay
left a comment
There was a problem hiding this comment.
Completed testing for Button component migration to Pressable. Also tested SwipeRating component changes. Both are working as expected - ready to merge
Migrate Button component to use Pressable
Migrate Button component to use Pressable

Motivation
Refactored the internal touchable logic to improve performance, cross-platform consistency, and code maintainability. This change moves away from legacy Platform.select component switching in favor of a unified Pressable implementation that correctly handles dynamic styling and Android ripple effects.
Fixes # (issue)
Type of change
How Has This Been Tested?
exampleappChecklist
yarn docs-build-apiAdditional context