UNPKG

370 BTypeScriptView Raw
1import * as React from 'react';
2
3import CardAnimationContext from './CardAnimationContext';
4
5export default function useCardAnimation() {
6 const animation = React.useContext(CardAnimationContext);
7
8 if (animation === undefined) {
9 throw new Error(
10 "Couldn't find values for card animation. Are you inside a screen in Stack?"
11 );
12 }
13
14 return animation;
15}