mirror of
https://github.com/tale/headplane.git
synced 2026-08-31 01:09:25 +00:00
fix: resolve type errors and lint components/routes
This commit is contained in:
@@ -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 ? (
|
||||
|
||||
Reference in New Issue
Block a user