Convert ScrollViewStickyHeader to functional component and gate the change

Summary:
Changelog:
[Internal][Added] - Use injected ScrollViewStickyHeader if set

Reviewed By: lunaleaps

Differential Revision: D26931404

fbshipit-source-id: 6f6f1b501b610a05999898be3e2ce08aeb4dab1b
This commit is contained in:
Kacie Bawiec
2021-03-29 15:25:19 -07:00
committed by Facebook GitHub Bot
parent 3b8fbc336c
commit eacabe1398
2 changed files with 24 additions and 1 deletions
@@ -20,6 +20,8 @@ import Platform from '../../Utilities/Platform';
import type {LayoutEvent} from '../../Types/CoreEventTypes';
import ScrollViewStickyHeaderInjection from './ScrollViewStickyHeaderInjection';
const AnimatedView = AnimatedImplementation.createAnimatedComponent(View);
export type Props = $ReadOnly<{
@@ -328,4 +330,8 @@ const styles = StyleSheet.create({
},
});
module.exports = ScrollViewStickyHeader;
const SHToExport: React.AbstractComponent<
Props,
$ReadOnly<{setNextHeaderY: number => void, ...}>,
> = ScrollViewStickyHeaderInjection.unstable_SH ?? ScrollViewStickyHeader;
module.exports = SHToExport;
@@ -0,0 +1,17 @@
/**
* 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 typeof ScrollViewStickyHeader from './ScrollViewStickyHeader';
export default {
unstable_SH: (null: ?ScrollViewStickyHeader),
};