mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add setNativeRefreshing command to SwipeRefreshLayoutManager
Summary: As a part of the migration from `setNativeProps` in Fabric and Paper, we are replacing it by view commands in the RefreshControl component on Android. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D18475428 fbshipit-source-id: f2e978d88e34c74771f8582247ecc82b2b942557
This commit is contained in:
committed by
Facebook Github Bot
parent
cd1e34d4a2
commit
c5c3264a94
@@ -10,6 +10,9 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
||||
import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
|
||||
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
||||
|
||||
@@ -65,6 +68,19 @@ type NativeProps = $ReadOnly<{|
|
||||
refreshing: boolean,
|
||||
|}>;
|
||||
|
||||
type NativeType = HostComponent<NativeProps>;
|
||||
|
||||
interface NativeCommands {
|
||||
+setNativeRefreshing: (
|
||||
viewRef: React.ElementRef<NativeType>,
|
||||
value: boolean,
|
||||
) => void;
|
||||
}
|
||||
|
||||
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
||||
supportedCommands: ['setNativeRefreshing'],
|
||||
});
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'AndroidSwipeRefreshLayout',
|
||||
): HostComponent<NativeProps>);
|
||||
): NativeType);
|
||||
|
||||
Reference in New Issue
Block a user