Skip to content

Commit e1f7a45

Browse files
authored
fix: Types in redux and Icons (#41)
1 parent 597aa72 commit e1f7a45

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/components/Auth/Auth/ProgressBar/Progressbar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
faUserSecret,
77
} from '@fortawesome/free-solid-svg-icons';
88
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
9+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
910
interface user {
1011
formNumber?: number;
1112
completed?: boolean;
@@ -37,7 +38,7 @@ export default function UserDetails(props: user): JSX.Element {
3738
}
3839
onClick={props.handleForm1}
3940
>
40-
<FontAwesomeIcon icon={faUser} />
41+
<FontAwesomeIcon icon={faUser as IconProp} />
4142
</button>
4243
</div>
4344
<div>
@@ -52,7 +53,7 @@ export default function UserDetails(props: user): JSX.Element {
5253
}
5354
onClick={props.handleForm2}
5455
>
55-
<FontAwesomeIcon icon={faUserSecret} />
56+
<FontAwesomeIcon icon={faUserSecret as IconProp} />
5657
</button>
5758
</div>
5859
<div>
@@ -62,7 +63,7 @@ export default function UserDetails(props: user): JSX.Element {
6263
!props.completed ? styles.levelInitiated : styles.levelCompleted
6364
}
6465
>
65-
<FontAwesomeIcon icon={faCode} />
66+
<FontAwesomeIcon icon={faCode as IconProp} />
6667
</button>
6768
</div>
6869
</div>

src/store/hooks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
2-
import type { RootState, AppDispatch } from './store';
3-
2+
import type { RootState } from './store';
3+
import { Dispatch } from 'react';
44
// Use throughout your app instead of plain `useDispatch` and `useSelector`
5-
export const useAppDispatch = (): AppDispatch => useDispatch<AppDispatch>();
5+
export const useAppDispatch = <T>(): Dispatch<T> => useDispatch<Dispatch<T>>();
66
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

0 commit comments

Comments
 (0)