Skip to content

Commit

Permalink
Fix 2 other random errors in console
Browse files Browse the repository at this point in the history
  • Loading branch information
TyHil committed Nov 25, 2024
1 parent 49d47e5 commit 4fb20ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/search/Filters/filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import {
InputLabel,
ListItemText,
MenuItem,
Select,
Tooltip,
} from '@mui/material';
import Select, { type SelectChangeEvent } from '@mui/material/Select';
import type { SelectChangeEvent } from '@mui/material/Select';
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';

Expand Down
7 changes: 4 additions & 3 deletions src/components/search/SearchBar/searchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import match from 'autosuggest-highlight/match';
import parse from 'autosuggest-highlight/parse';
import { useRouter } from 'next/router';
import React, { useEffect, useRef, useState } from 'react';
import React, { type Key, useEffect, useRef, useState } from 'react';

import {
decodeSearchQueryLabel,
Expand Down Expand Up @@ -283,7 +283,7 @@ const SearchBar = ({
}
}
}}
renderOption={(props, option, { inputValue }) => {
renderOption={(props: { key: Key }, option, { inputValue }) => {
const text =
typeof option === 'string' ? option : searchQueryLabel(option);
//add spaces between prefix and course number
Expand All @@ -302,8 +302,9 @@ const SearchBar = ({
),
);
const parts = parse(text, matches);
const { key, ...otherProps } = props;
return (
<li {...props}>
<li key={key} {...otherProps}>
{parts.map((part, index) => (
<span
key={index}
Expand Down

0 comments on commit 4fb20ee

Please sign in to comment.