Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting proper typing on Popper types in Popover #2895

Open
JonathanLorimer opened this issue May 13, 2024 · 1 comment
Open

Not getting proper typing on Popper types in Popover #2895

JonathanLorimer opened this issue May 13, 2024 · 1 comment

Comments

@JonathanLorimer
Copy link

JonathanLorimer commented May 13, 2024

Question

When I check out the types of PopperContentProps in my editor I see this:

type PopperContentProps = Radix.ComponentPropsWithoutRef<any>

which is giving me any on all the popover props I care about.

However if I go to definition I see this chain:

// go to defintion of PoperContentProps
type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
// go to definition of Popper.Primitive.Content
export const Content: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>;
// go to definition of PopperContentProps
export interface PopperContentProps extends PrimitiveDivProps {
    side?: Side;
    sideOffset?: number;
    align?: Align;
    alignOffset?: number;
    arrowPadding?: number;
    avoidCollisions?: boolean;
    collisionBoundary?: Boundary | Boundary[];
    collisionPadding?: number | Partial<Record<Side, number>>;
    sticky?: 'partial' | 'always';
    hideWhenDetached?: boolean;
    updatePositionStrategy?: 'optimized' | 'always';
    onPlaced?: () => void;
}

The go to definition seems to be what I want, not sure why I am getting any in my LSP, I wonder if the name collision between PoperContentProps is causing an infinite loop?

@JonathanLorimer
Copy link
Author

JonathanLorimer commented May 13, 2024

May be related to use of typescript 5^ and react 18^, see related issue #2309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant