mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-13 22:30:41 +08:00
feat: expose header height in context
This commit is contained in:
14
packages/stack/src/utils/useCardAnimation.tsx
Normal file
14
packages/stack/src/utils/useCardAnimation.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import CardAnimationContext from './CardAnimationContext';
|
||||
|
||||
export default function useCardAnimation() {
|
||||
const animation = React.useContext(CardAnimationContext);
|
||||
|
||||
if (animation === undefined) {
|
||||
throw new Error(
|
||||
"Couldn't find values for card animation. Are you inside a screen in Stack?"
|
||||
);
|
||||
}
|
||||
|
||||
return animation;
|
||||
}
|
||||
Reference in New Issue
Block a user