Closed Elie-A-98 closed 9 months ago
Interesting. I wonder if using TextLinkProps
would fix it. This is the source code for TextLink
:
'use client'
import { TextProps, Text } from 'react-native'
import { LinkCore } from './core'
import { LinkCoreProps } from './LinkCoreProps'
type TextLinkProps = LinkCoreProps & { textProps?: TextProps }
function TextLink({ textProps, ...props }: TextLinkProps) {
return (
<LinkCore
{...props}
Component={Text}
componentProps={{ selectable: false, ...textProps }}
/>
)
}
export { TextLink }
export type { TextLinkProps }
I think you can fix it by simply passing props
directly to TextLink
.
Is there an existing issue for this?
Do you want this issue prioritized?
Current Behavior
If restOfProps is of type
Omit<ComponentProps<typeof TextLink>, 'className'>
the below results in an error:<TextLink {...restOfProps}>{children}</TextLink>
Error:
Type '{ children: ReactNode; id?: string | undefined; style?: CSSProperties | undefined; href: string | UrlObject; 'aria-label'?: string | undefined; ... 277 more ...; textProps?: TextProps | undefined; }' is not assignable to type 'IntrinsicAttributes & TextLinkProps'. Type '{ children: ReactNode; id?: string | undefined; style?: CSSProperties | undefined; href: string | UrlObject; 'aria-label'?: string | undefined; ... 277 more ...; textProps?: TextProps | undefined; }' is not assignable to type '{ replace: true; experimental?: { nativeBehavior: "stack-replace"; isNestedNavigator: boolean; } | undefined; }'. Types of property 'replace' are incompatible. Type 'boolean | undefined' is not assignable to type 'true'. Type 'undefined' is not assignable to type 'true'.ts(2322)
Expected Behavior
The below works normally
Steps To Reproduce
Create solito project using minimal starter template: https://solito.dev/starter Create the below component: