Skip to content

Commit

Permalink
add return type to hoc
Browse files Browse the repository at this point in the history
  • Loading branch information
JKobrynski committed Oct 16, 2023
1 parent 1c09561 commit 6119982
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/withNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ type WithNavigationProps = {
navigation: NavigationProp<ReactNavigation.RootParamList>;
};

export default function withNavigation<TProps extends WithNavigationProps, TRef>(WrappedComponent: ComponentType<TProps & RefAttributes<TRef>>) {
export default function withNavigation<TProps extends WithNavigationProps, TRef>(
WrappedComponent: ComponentType<TProps & RefAttributes<TRef>>,
): (props: Omit<TProps, keyof WithNavigationProps>, ref: ForwardedRef<TRef>) => React.JSX.Element | null {
function WithNavigation(props: Omit<TProps, keyof WithNavigationProps>, ref: ForwardedRef<TRef>) {
const navigation = useNavigation();
return (
Expand Down

0 comments on commit 6119982

Please sign in to comment.