Skip to content

Commit

Permalink
chore: fix type of usePrevious hook
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuth committed Sep 29, 2022
1 parent f2fc07f commit f494708
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export const Tabs = ({
* Get the previous value of a prop. Useful for comparing the previous to the current value.
*/
function usePrevious<T>(prop: T) {
const ref = useRef<T | undefined>();
const ref = useRef<T>(prop);
useEffect(() => {
ref.current = prop;
});
Expand Down

0 comments on commit f494708

Please sign in to comment.