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:
parent
38553bfa85
commit
cd37104e15
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue