Skip to content

Commit

Permalink
add typing for registerBeforeNext and @ts-expect-error for CurrentInt…
Browse files Browse the repository at this point in the history
…erface
  • Loading branch information
jthrilly committed Jan 19, 2024
1 parent ecb3190 commit 05f1108
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/interviewer/containers/Stage.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import getInterface from './Interfaces';
import StageErrorBoundary from '../components/StageErrorBoundary';
import { motion } from 'framer-motion';
import type { directions } from '../hooks/useNavigationHelpers';

type StageProps = {
stage: {
id: string;
type: string;
};
registerBeforeNext: () => void;
registerBeforeNext: (direction: directions) => boolean;
};

const Stage = (props: StageProps) => {
Expand All @@ -34,6 +35,7 @@ const Stage = (props: StageProps) => {
>
<StageErrorBoundary>
{CurrentInterface && (
// @ts-expect-error I can't work out how to correctly type this...
<CurrentInterface
registerBeforeNext={registerBeforeNext}
stage={stage}
Expand Down
2 changes: 1 addition & 1 deletion lib/interviewer/hooks/useNavigationHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import usePrevious from '~/hooks/usePrevious';
import type { AnyAction } from '@reduxjs/toolkit';
import { parseAsInteger, useQueryState } from 'nuqs';

type directions = 'forwards' | 'backwards';
export type directions = 'forwards' | 'backwards';

export const useNavigationHelpers = () => {
const dispatch = useDispatch();
Expand Down

0 comments on commit 05f1108

Please sign in to comment.