Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
refactor: share fallback descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Sep 14, 2019
1 parent d16c20c commit 17045f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/stack/src/views/Stack/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ const { cond, eq } = Animated;

const ANIMATED_ONE = new Animated.Value(1);

const FALLBACK_DESCRIPTOR = Object.freeze({ options: {} });

const getFloatingHeaderHeights = (
routes: Route<string>[],
layout: Layout,
Expand Down Expand Up @@ -174,7 +176,7 @@ export default class Stack extends React.Component<Props, State> {
descriptor:
props.descriptors[route.key] ||
state.descriptors[route.key] ||
(oldScene ? oldScene.descriptor : { options: {} }),
(oldScene ? oldScene.descriptor : FALLBACK_DESCRIPTOR),
progress: {
current,
next,
Expand Down

0 comments on commit 17045f5

Please sign in to comment.