mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-06 17:52:57 +08:00
Unify scene rederer params that are used render the scene / header.
Reviewed By: fkgozali Differential Revision: D2981045 fb-gh-sync-id: 21688d92e31d882c5a31dd83ca064c2a01837164 shipit-source-id: 21688d92e31d882c5a31dd83ca064c2a01837164
This commit is contained in:
committed by
Facebook Github Bot 9
parent
e55cefc476
commit
73bdef4089
@@ -44,22 +44,22 @@ import type {
|
||||
|
||||
import type {
|
||||
Layout,
|
||||
OverlayRenderer,
|
||||
NavigationStateRenderer,
|
||||
NavigationStateRendererProps,
|
||||
Position,
|
||||
SceneRenderer,
|
||||
} from 'NavigationAnimatedView';
|
||||
|
||||
type Props = {
|
||||
navigationState: NavigationParentState,
|
||||
renderOverlay: OverlayRenderer,
|
||||
renderScene: SceneRenderer,
|
||||
renderOverlay: NavigationStateRenderer,
|
||||
renderScene: NavigationStateRenderer,
|
||||
};
|
||||
|
||||
/**
|
||||
* A controlled navigation view that renders a list of cards.
|
||||
*/
|
||||
class NavigationCardStack extends React.Component {
|
||||
_renderScene : SceneRenderer;
|
||||
_renderScene : NavigationStateRenderer;
|
||||
|
||||
constructor(props: Props, context: any) {
|
||||
super(props, context);
|
||||
@@ -77,20 +77,22 @@ class NavigationCardStack extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
_renderScene(
|
||||
navigationState: NavigationState,
|
||||
index: number,
|
||||
position: Position,
|
||||
layout: Layout,
|
||||
): ReactElement {
|
||||
_renderScene(props: NavigationStateRendererProps): ReactElement {
|
||||
const {
|
||||
index,
|
||||
layout,
|
||||
navigationParentState,
|
||||
navigationState,
|
||||
position,
|
||||
} = props;
|
||||
return (
|
||||
<NavigationCard
|
||||
key={navigationState.key}
|
||||
index={index}
|
||||
navigationState={navigationState}
|
||||
navigationState={navigationParentState}
|
||||
position={position}
|
||||
layout={layout}>
|
||||
{this.props.renderScene(navigationState, index, position, layout)}
|
||||
{this.props.renderScene(props)}
|
||||
</NavigationCard>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user