mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix BorderExample Crash on Out of Tree Platforms (#32120)
Summary: https://github.com/facebook/react-native/commit/9b4f8e01442356f820e135fae3849063b2b8c92c#diff-ee44452e2deeb3a607e863852bb720518875b88c4e78ea7dc76805488bfb1818 added examples to the border test page using PlatformColor. An iOS specific instance was later conditioned to only iOS in https://github.com/facebook/react-native/commit/f6d0f9deaccdc53114d47b8a69c49fda7cb1f8e1#diff-ee44452e2deeb3a607e863852bb720518875b88c4e78ea7dc76805488bfb1818 but one example remains that has values for Android, and iOS only. This causes a crash on at least RNW, since none of the PlatformColors are valid. This change addsa a fallback to black for unsupported platforms, and also adds a Windows PlatformColor for kicks (and marginal extra usefuleness). ## Changelog [Internal] [Fixed] - Fix BorderExample Crash on Out of Tree Platforms Pull Request resolved: https://github.com/facebook/react-native/pull/32120 Test Plan: Validated on RNTester on Windows. Reviewed By: yungsters Differential Revision: D30822765 Pulled By: lunaleaps fbshipit-source-id: 6b3e65204259205bb2f3c9153a2361d1decebe98
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fc553ed8e6
commit
ffcaef64e4
@@ -183,10 +183,12 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
border15: {
|
||||
borderWidth: 10,
|
||||
borderColor: PlatformColor(
|
||||
'systemGray4',
|
||||
'@android:color/holo_orange_dark',
|
||||
),
|
||||
borderColor: Platform.select({
|
||||
ios: PlatformColor('systemGray4'),
|
||||
android: PlatformColor('@android:color/holo_orange_dark'),
|
||||
windows: PlatformColor('SystemAccentColorDark1'),
|
||||
default: 'black',
|
||||
}),
|
||||
},
|
||||
border16: {
|
||||
borderWidth: 10,
|
||||
|
||||
Reference in New Issue
Block a user