Skip to content

Commit

Permalink
fix ts problems
Browse files Browse the repository at this point in the history
  • Loading branch information
MayGo committed Feb 2, 2025
1 parent 71a464c commit 363b312
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default tseslint.config(
},
rules: {
...reactHooks.configs.recommended.rules,
'react-compiler/react-compiler': 'error',
'react-compiler/react-compiler': 'warn',
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
},
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/Timeline/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { SmallTimelineChart } from './SmallTimelineChart';
import { Loader } from './Loader';

export const Timeline = memo(() => {
const popoverTriggerRef = useRef();
const popoverTriggerRef = useRef<HTMLDivElement>(null);

const isLoading = useStoreState((state) => state.isLoading);

Expand All @@ -23,7 +23,9 @@ export const Timeline = memo(() => {
<MainTimelineChart />
</BlackBox>
<Popover isOpen={!!selectedTimelineItem}>
<PopoverTrigger>{popoverTriggerRef.current || <div />}</PopoverTrigger>
<PopoverTrigger>
<div ref={popoverTriggerRef} />
</PopoverTrigger>
<PopoverContent p={4} w="fit-content" boxShadow="lg" bg="gray.50">
<PopoverArrow bg="gray.50" />
<PopoverBody p={0}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function TimelineItemEditDeleteButton({ deleteItem }) {
deleteItem();
onClose();
};
const cancelRef = useRef(null);
const cancelRef = useRef<HTMLButtonElement>(null!);

return (
<>
Expand Down
5 changes: 3 additions & 2 deletions client/src/components/TrackItemTable/ToggleColumnFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { SearchIcon } from '@chakra-ui/icons';

export function ToggleColumnFilter({ children }) {
const { onOpen, onClose, isOpen } = useDisclosure();
const firstFieldRef = useRef(null);
const firstFieldRef = useRef<HTMLInputElement>(null!);

const form = cloneElement(children, { ref: firstFieldRef, onCancel: onClose });

return (
<Popover
isOpen={isOpen}
initialFocusRef={firstFieldRef}
initialFocusRef={firstFieldRef as React.RefObject<{ focus(): void }>}
onOpen={onOpen}
onClose={onClose}
placement="right"
Expand Down

0 comments on commit 363b312

Please sign in to comment.