Skip to content

Commit 0c744de

Browse files
GijsWeteringsfacebook-github-bot
authored andcommitted
Back out "Introduce a PlatformBaseViewConfig for all HostComponents"
Summary: Changelog: [Internal] Reviewed By: arushikesarwani94 Differential Revision: D33042499 fbshipit-source-id: 603fbfa4e2f482c5d002532745a29170daded184
1 parent cab1635 commit 0c744de

File tree

6 files changed

+15
-451
lines changed

6 files changed

+15
-451
lines changed

Libraries/Components/View/ViewNativeComponent.js

+3-64
Original file line numberDiff line numberDiff line change
@@ -12,73 +12,12 @@ import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentR
1212
import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes';
1313
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
1414
import {type ViewProps as Props} from './ViewPropTypes';
15-
import Platform from '../../Utilities/Platform';
16-
1715
import * as React from 'react';
1816

19-
const ViewPartialViewConfig =
20-
Platform.OS === 'android'
21-
? {
22-
uiViewClassName: 'RCTView',
23-
validAttributes: {
24-
// ReactClippingViewManager @ReactProps
25-
removeClippedSubviews: true,
26-
27-
// ReactViewManager @ReactProps
28-
accessible: true,
29-
hasTVPreferredFocus: true,
30-
nextFocusDown: true,
31-
nextFocusForward: true,
32-
nextFocusLeft: true,
33-
nextFocusRight: true,
34-
nextFocusUp: true,
35-
36-
borderRadius: true,
37-
borderTopLeftRadius: true,
38-
borderTopRightRadius: true,
39-
borderBottomRightRadius: true,
40-
borderBottomLeftRadius: true,
41-
borderTopStartRadius: true,
42-
borderTopEndRadius: true,
43-
borderBottomStartRadius: true,
44-
borderBottomEndRadius: true,
45-
46-
borderStyle: true,
47-
hitSlop: true,
48-
pointerEvents: true,
49-
nativeBackgroundAndroid: true,
50-
nativeForegroundAndroid: true,
51-
needsOffscreenAlphaCompositing: true,
52-
53-
borderWidth: true,
54-
borderLeftWidth: true,
55-
borderRightWidth: true,
56-
borderTopWidth: true,
57-
borderBottomWidth: true,
58-
borderStartWidth: true,
59-
borderEndWidth: true,
60-
61-
borderColor: {process: require('../../StyleSheet/processColor')},
62-
borderLeftColor: {process: require('../../StyleSheet/processColor')},
63-
borderRightColor: {process: require('../../StyleSheet/processColor')},
64-
borderTopColor: {process: require('../../StyleSheet/processColor')},
65-
borderBottomColor: {
66-
process: require('../../StyleSheet/processColor'),
67-
},
68-
borderStartColor: {process: require('../../StyleSheet/processColor')},
69-
borderEndColor: {process: require('../../StyleSheet/processColor')},
70-
71-
focusable: true,
72-
overflow: true,
73-
backfaceVisibility: true,
74-
},
75-
}
76-
: {
77-
uiViewClassName: 'RCTView',
78-
};
79-
8017
const ViewNativeComponent: HostComponent<Props> =
81-
NativeComponentRegistry.get<Props>('RCTView', () => ViewPartialViewConfig);
18+
NativeComponentRegistry.get<Props>('RCTView', () => ({
19+
uiViewClassName: 'RCTView',
20+
}));
8221

8322
interface NativeCommands {
8423
+hotspotUpdate: (

Libraries/Core/setUpReactDevTools.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,12 @@ if (__DEV__) {
5858
isWebSocketOpen = true;
5959
});
6060

61-
const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
62-
61+
const viewConfig = require('../Components/View/ReactNativeViewViewConfig');
6362
reactDevTools.connectToDevTools({
6463
isAppActive,
6564
resolveRNStyle: require('../StyleSheet/flattenStyle'),
6665
nativeStyleEditorValidAttributes: Object.keys(
67-
ReactNativeStyleAttributes,
66+
viewConfig.validAttributes.style,
6867
),
6968
websocket: ws,
7069
});

Libraries/Inspector/Inspector.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const React = require('react');
1919
const ReactNative = require('../Renderer/shims/ReactNative');
2020
const StyleSheet = require('../StyleSheet/StyleSheet');
2121
const View = require('../Components/View/View');
22-
const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
2322

2423
const invariant = require('invariant');
2524

@@ -48,7 +47,10 @@ const renderers = findRenderers();
4847
// Required for React DevTools to view/edit React Native styles in Flipper.
4948
// Flipper doesn't inject these values when initializing DevTools.
5049
hook.resolveRNStyle = require('../StyleSheet/flattenStyle');
51-
hook.nativeStyleEditorValidAttributes = Object.keys(ReactNativeStyleAttributes);
50+
const viewConfig = require('../Components/View/ReactNativeViewViewConfig');
51+
hook.nativeStyleEditorValidAttributes = Object.keys(
52+
viewConfig.validAttributes.style,
53+
);
5254

5355
function findRenderers(): $ReadOnlyArray<ReactRenderer> {
5456
const allRenderers = Array.from(hook.renderers.values());

0 commit comments

Comments
 (0)