3 ms·
Thanks. Is that's really what's happening with React Native's built-in button though? https://github.com/facebook/react-native/blob/master/Libraries/Components
by Kiro 9y ago
Thanks. Is that's really what's happening with React Native's built-in button though?
https://github.com/facebook/react-native/blob/master/Libraries/Components/Button.js https://github.com/facebook/react-native/blob/master/Librari...
if (color && Platform.OS === 'ios') {
textStyles.push({color: color});
} else if (color) {
buttonStyles.push({backgroundColor: color});
}
Looks like they are just styling them differently to make them look like system default.
- pavlov 9y agoSorry, I don't know how React Native does it, although my understanding is that Button components do end up as real platform buttons. Generally speaking, UIButtons have important semantics that are easy to miss if one just reproduces the appearance using custom graphics. The same applies to other standard controls too.