RN: Rename to `ScrollViewNativeComponent`
Summary: There may be assumptions that `Native*.js` contains TurboModule. In order to avoid introducing unplanned breaking changes (especially right before the holidays), roll this back for now. In doing so, I also realized that I forgot to migrate over `ScrollContentViewNativeComponent`. This does that, too. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D25129324 fbshipit-source-id: 343c4b800969dab91f7cd9f2bf253788c94d38e6
This commit is contained in:
Родитель
f9a4cafa20
Коммит
9dfefa8da0
|
@ -14,7 +14,7 @@ import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|||
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
|
||||
import {type ViewProps as Props} from '../View/ViewPropTypes';
|
||||
|
||||
const NativeAndroidHorizontalScrollContentView: HostComponent<Props> = NativeComponentRegistry.get<Props>(
|
||||
const AndroidHorizontalScrollContentViewNativeComponent: HostComponent<Props> = NativeComponentRegistry.get<Props>(
|
||||
'AndroidHorizontalScrollContentView',
|
||||
() => ({
|
||||
uiViewClassName: 'AndroidHorizontalScrollContentView',
|
||||
|
@ -24,4 +24,4 @@ const NativeAndroidHorizontalScrollContentView: HostComponent<Props> = NativeCom
|
|||
}),
|
||||
);
|
||||
|
||||
export default NativeAndroidHorizontalScrollContentView;
|
||||
export default AndroidHorizontalScrollContentViewNativeComponent;
|
|
@ -14,7 +14,7 @@ import {type ScrollViewNativeProps as Props} from './ScrollViewNativeComponentTy
|
|||
import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
||||
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
|
||||
|
||||
const NativeAndroidHorizontalScrollView: HostComponent<Props> = NativeComponentRegistry.get<Props>(
|
||||
const AndroidHorizontalScrollViewNativeComponent: HostComponent<Props> = NativeComponentRegistry.get<Props>(
|
||||
'AndroidHorizontalScrollView',
|
||||
() => ({
|
||||
uiViewClassName: 'AndroidHorizontalScrollView',
|
||||
|
@ -42,4 +42,4 @@ const NativeAndroidHorizontalScrollView: HostComponent<Props> = NativeComponentR
|
|||
}),
|
||||
);
|
||||
|
||||
export default NativeAndroidHorizontalScrollView;
|
||||
export default AndroidHorizontalScrollViewNativeComponent;
|
|
@ -1,39 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import registerGeneratedViewConfig from '../../Utilities/registerGeneratedViewConfig';
|
||||
import requireNativeComponent from '../../ReactNative/requireNativeComponent';
|
||||
|
||||
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
||||
import type {ViewProps} from '../View/ViewPropTypes';
|
||||
|
||||
const ScrollContentViewViewConfig = {
|
||||
uiViewClassName: 'RCTScrollContentView',
|
||||
bubblingEventTypes: {},
|
||||
directEventTypes: {},
|
||||
validAttributes: {},
|
||||
};
|
||||
|
||||
let ScrollContentViewNativeComponent;
|
||||
if (global.RN$Bridgeless) {
|
||||
registerGeneratedViewConfig(
|
||||
'RCTScrollContentView',
|
||||
ScrollContentViewViewConfig,
|
||||
);
|
||||
ScrollContentViewNativeComponent = 'RCTScrollContentView';
|
||||
} else {
|
||||
ScrollContentViewNativeComponent = requireNativeComponent<ViewProps>(
|
||||
'RCTScrollContentView',
|
||||
);
|
||||
}
|
||||
|
||||
export default ((ScrollContentViewNativeComponent: any): HostComponent<ViewProps>);
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
||||
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
|
||||
import {type ViewProps as Props} from '../View/ViewPropTypes';
|
||||
|
||||
const ScrollContentViewNativeComponent: HostComponent<Props> = NativeComponentRegistry.get<Props>(
|
||||
'RCTScrollContentView',
|
||||
() => ({
|
||||
uiViewClassName: 'RCTScrollContentView',
|
||||
bubblingEventTypes: {},
|
||||
directEventTypes: {},
|
||||
validAttributes: {},
|
||||
}),
|
||||
);
|
||||
|
||||
export default ScrollContentViewNativeComponent;
|
|
@ -40,30 +40,31 @@ import type {
|
|||
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
||||
import type {State as ScrollResponderState} from '../ScrollResponder';
|
||||
import type {ViewProps} from '../View/ViewPropTypes';
|
||||
import NativeAndroidHorizontalScrollContentView from './NativeAndroidHorizontalScrollContentView';
|
||||
import NativeAndroidHorizontalScrollView from './NativeAndroidHorizontalScrollView';
|
||||
import NativeScrollContentView from './NativeScrollContentView';
|
||||
import NativeScrollView from './NativeScrollView';
|
||||
import ScrollViewContext, {HORIZONTAL, VERTICAL} from './ScrollViewContext';
|
||||
import type {Props as ScrollViewStickyHeaderProps} from './ScrollViewStickyHeader';
|
||||
|
||||
import AndroidHorizontalScrollContentViewNativeComponent from './AndroidHorizontalScrollContentViewNativeComponent';
|
||||
import AndroidHorizontalScrollViewNativeComponent from './AndroidHorizontalScrollViewNativeComponent';
|
||||
import ScrollContentViewNativeComponent from './ScrollContentViewNativeComponent';
|
||||
import ScrollViewNativeComponent from './ScrollViewNativeComponent';
|
||||
|
||||
const {NativeHorizontalScrollViewTuple, NativeVerticalScrollViewTuple} =
|
||||
Platform.OS === 'android'
|
||||
? {
|
||||
NativeHorizontalScrollViewTuple: [
|
||||
NativeAndroidHorizontalScrollView,
|
||||
NativeAndroidHorizontalScrollContentView,
|
||||
AndroidHorizontalScrollViewNativeComponent,
|
||||
AndroidHorizontalScrollContentViewNativeComponent,
|
||||
],
|
||||
NativeVerticalScrollViewTuple: [NativeScrollView, View],
|
||||
NativeVerticalScrollViewTuple: [ScrollViewNativeComponent, View],
|
||||
}
|
||||
: {
|
||||
NativeHorizontalScrollViewTuple: [
|
||||
NativeScrollView,
|
||||
NativeScrollContentView,
|
||||
ScrollViewNativeComponent,
|
||||
ScrollContentViewNativeComponent,
|
||||
],
|
||||
NativeVerticalScrollViewTuple: [
|
||||
NativeScrollView,
|
||||
NativeScrollContentView,
|
||||
ScrollViewNativeComponent,
|
||||
ScrollContentViewNativeComponent,
|
||||
],
|
||||
};
|
||||
|
||||
|
@ -592,7 +593,7 @@ export type Props = $ReadOnly<{|
|
|||
* measure, measureLayout, etc.
|
||||
*/
|
||||
scrollViewRef?: React.Ref<
|
||||
typeof NativeScrollView & ScrollViewImperativeMethods,
|
||||
typeof ScrollViewNativeComponent & ScrollViewImperativeMethods,
|
||||
>,
|
||||
|}>;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import {type ScrollViewNativeProps as Props} from './ScrollViewNativeComponentTy
|
|||
import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
||||
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
|
||||
|
||||
const NativeScrollView: HostComponent<Props> = NativeComponentRegistry.get<Props>(
|
||||
const ScrollViewNativeComponent: HostComponent<Props> = NativeComponentRegistry.get<Props>(
|
||||
'RCTScrollView',
|
||||
() => ({
|
||||
uiViewClassName: 'RCTScrollView',
|
||||
|
@ -84,4 +84,4 @@ const NativeScrollView: HostComponent<Props> = NativeComponentRegistry.get<Props
|
|||
}),
|
||||
);
|
||||
|
||||
export default NativeScrollView;
|
||||
export default ScrollViewNativeComponent;
|
|
@ -19,7 +19,7 @@ const StyleSheet = require('../StyleSheet/StyleSheet');
|
|||
|
||||
const invariant = require('invariant');
|
||||
|
||||
import typeof NativeScrollView from '../Components/ScrollView/NativeScrollView';
|
||||
import typeof ScrollViewNativeComponent from '../Components/ScrollView/ScrollViewNativeComponent';
|
||||
import {type ScrollResponderType} from '../Components/ScrollView/ScrollView';
|
||||
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
||||
import type {
|
||||
|
@ -373,7 +373,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|||
*/
|
||||
getNativeScrollRef():
|
||||
| ?React.ElementRef<typeof View>
|
||||
| ?React.ElementRef<NativeScrollView> {
|
||||
| ?React.ElementRef<ScrollViewNativeComponent> {
|
||||
if (this._listRef) {
|
||||
return this._listRef.getScrollRef();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче