Skip to content

Commit cd37104

Browse files
committed
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>
1 parent 38553bf commit cd37104

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/mobile/src/components/ui/typography/Text.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { cn } from "@follow/utils"
2-
import type { FC } from "react"
2+
import type { FC, Ref } from "react"
33
import type { TextProps } from "react-native"
44
import { Text as RNText } from "react-native"
55

66
import { useUISettingKey } from "@/src/atoms/settings/ui"
77

8-
export const Text: FC<TextProps> = (props) => {
8+
export const Text: FC<TextProps & { ref?: Ref<RNText> }> = (props) => {
99
const systemFontScaling = useUISettingKey("useSystemFontScaling")
1010

1111
return (

apps/mobile/src/lib/navigation/NavigationLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TextProps } from "react-native"
1+
import type { Text as RNText, TextProps } from "react-native"
22
import type { StackPresentationTypes } from "react-native-screens"
33

44
import { Text } from "@/src/components/ui/typography/Text"
@@ -10,7 +10,7 @@ interface NavigationLinkProps<T> extends TextProps {
1010
destination: NavigationControllerView<T>
1111
stackPresentation?: StackPresentationTypes
1212
props?: T
13-
ref?: React.Ref<Text>
13+
ref?: React.Ref<RNText>
1414
}
1515
export function NavigationLink<T>({
1616
destination,

0 commit comments

Comments
 (0)