Closed thebiltheory closed 1 month ago
@roninoss have you encountered a similar issue?
I'm seeing similar errors running tsc
../../packages/app-ui/src/components/ui/IFSelect.tsx:42:3 - error TS2339: Property 'className' does not exist on type '{}'.
42 className,
~~~~~~~~~
../../packages/app-ui/src/components/ui/IFSelect.tsx:44:35 - error TS2344: Type '({ children }: { children?: ReactNode; className?: string; }) => ReactNode' does not satisfy the constraint 'ElementType<any, keyof IntrinsicElements>'.
Type '({ children }: { children?: ReactNode; className?: string; }) => ReactNode' is not assignable to type 'FunctionComponent<any>'.
Type 'ReactNode' is not assignable to type 'ReactElement<any, any>'.
Type 'string' is not assignable to type 'ReactElement<any, any>'.
44 }: React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>) => {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../packages/app-ui/src/components/ui/IFSelect.tsx:49:6 - error TS2786: 'SelectPrimitive.ScrollUpButton' cannot be used as a JSX component.
Its return type 'ReactNode' is not a valid JSX element.
49 <SelectPrimitive.ScrollUpButton
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../packages/app-ui/src/components/ui/IFSelect.tsx:64:3 - error TS2339: Property 'className' does not exist on type '{}'.
64 className,
~~~~~~~~~
../../packages/app-ui/src/components/ui/IFSelect.tsx:66:35 - error TS2344: Type '({ children }: { children?: ReactNode; className?: string; }) => ReactNode' does not satisfy the constraint 'ElementType<any, keyof IntrinsicElements>'.
Type '({ children }: { children?: ReactNode; className?: string; }) => ReactNode' is not assignable to type 'FunctionComponent<any>'.
Type 'ReactNode' is not assignable to type 'ReactElement<any, any>'.
66 }: React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>) => {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../packages/app-ui/src/components/ui/IFSelect.tsx:71:6 - error TS2786: 'SelectPrimitive.ScrollDownButton' cannot be used as a JSX component.
Its return type 'ReactNode' is not a valid JSX element.
71 <SelectPrimitive.ScrollDownButton
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../packages/app-ui/src/components/ui/IFSelect.tsx:109:14 - error TS2786: 'SelectPrimitive.Viewport' cannot be used as a JSX component.
Its return type 'ReactNode' is not a valid JSX element.
109 <SelectPrimitive.Viewport
~~~~~~~~~~~~~~~~~~~~~~~~
Found 7 errors in the same file, starting at: ../../packages/app-ui/src/components/ui/IFSelect.tsx:42
Fixed in latest versions
TypeScript Error: Exported variables from @rn-primitives components cannot be named
Environment
@rn-primitives/*
(affecting multiple components)Description
When trying to use components from various
@rn-primitives/*
packages, I'm encountering TypeScript errors (TS4023) across multiple components. The error suggests that the exported variables (likeAvatar
, and presumably others) are using names from external modules that cannot be named.Error Message
Here's an example with the Avatar component, but this issue affects almost all components from @rn-primitives:
Steps to Reproduce
@rn-primitives/*
packagesExpected Behavior
Components from
@rn-primitives/*
packages should be importable and usable without TypeScript errors.Actual Behavior
TypeScript throws TS4023 errors when trying to use most components from
@rn-primitives/*
packages.Additional Context
@rn-primitives/*
packages.Possible Solutions
Any insights into resolving this type conflict would be greatly appreciated. Some questions that might help:
@rn-primitives/*
packages in a Turborepo setup?@rn-primitives/*
packages?@rn-primitives/*
that I'm using?Thank you !