fix(mobile): update Text component to support ref forwarding

- Modified Text component to accept a ref prop for better integration with React Native components.
- Updated NavigationLink to use the new ref type for improved type safety.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-07-24 01:54:35 +08:00
parent 38553bfa85
commit cd37104e15
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 4 additions and 4 deletions

View File

@ -1,11 +1,11 @@
import { cn } from "@follow/utils"
import type { FC } from "react"
import type { FC, Ref } from "react"
import type { TextProps } from "react-native"
import { Text as RNText } from "react-native"
import { useUISettingKey } from "@/src/atoms/settings/ui"
export const Text: FC<TextProps> = (props) => {
export const Text: FC<TextProps & { ref?: Ref<RNText> }> = (props) => {
const systemFontScaling = useUISettingKey("useSystemFontScaling")
return (

View File

@ -1,4 +1,4 @@
import type { TextProps } from "react-native"
import type { Text as RNText, TextProps } from "react-native"
import type { StackPresentationTypes } from "react-native-screens"
import { Text } from "@/src/components/ui/typography/Text"
@ -10,7 +10,7 @@ interface NavigationLinkProps<T> extends TextProps {
destination: NavigationControllerView<T>
stackPresentation?: StackPresentationTypes
props?: T
ref?: React.Ref<Text>
ref?: React.Ref<RNText>
}
export function NavigationLink<T>({
destination,