UNPKG

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