fix: resolve type errors and lint components/routes

This commit is contained in:
Aarnav Tale
2025-01-06 08:18:46 +05:30
parent 414b95c293
commit 6745ee8529
13 changed files with 63 additions and 28 deletions
+11 -6
View File
@@ -1,7 +1,15 @@
import { XIcon } from '@primer/octicons-react';
import { type AriaToastProps, useToast, useToastRegion } from '@react-aria/toast';
import { ToastQueue, type ToastState, useToastQueue } from '@react-stately/toast';
import { type ReactNode, useRef } from 'react';
import {
AriaToastProps,
useToast,
useToastRegion,
} from '@react-aria/toast';
import {
ToastQueue,
ToastState,
useToastQueue,
} from '@react-stately/toast';
import { ReactNode, useRef } from 'react';
import { Button } from 'react-aria-components';
import { createPortal } from 'react-dom';
import { ClientOnly } from 'remix-utils/client-only';
@@ -14,7 +22,6 @@ type ToastProps = AriaToastProps<ReactNode> & {
function Toast({ state, ...properties }: ToastProps) {
const reference = useRef(null);
// @ts-expect-error: RefObject doesn't map to FocusableElement?
const { toastProps, titleProps, closeButtonProps } = useToast(
properties,
state,
@@ -58,13 +65,11 @@ export function Toaster() {
const reference = useRef(null);
const state = useToastQueue(toasts);
// @ts-expect-error: React 19 has weird types for Portal vs Node
const { regionProps } = useToastRegion({}, state, reference);
return (
<ClientOnly>
{
// @ts-expect-error: Portal doesn't match Node in React 19 yet
() =>
createPortal(
state.visibleToasts.length >= 0 ? (