import type { TextProps } from 'react-native'

import { type ComponentType, createElement, forwardRef } from 'react'

import { createUnistylesElement } from '../../core'

// credits to @hirbod
const LeanText = forwardRef((props, ref) => {
    return createElement('RCTText', { ...props, ref })
}) as ComponentType<TextProps>

LeanText.displayName = 'RCTText'

export const NativeText = createUnistylesElement(LeanText)
