Skip to content

Instantly share code, notes, and snippets.

@Ryiski
Forked from hirbod/LeanText.tsx
Created January 30, 2025 06:23
Show Gist options
  • Save Ryiski/397f987cf32075fb2c537408bf913c9a to your computer and use it in GitHub Desktop.
Save Ryiski/397f987cf32075fb2c537408bf913c9a to your computer and use it in GitHub Desktop.

Revisions

  1. @hirbod hirbod renamed this gist Oct 27, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @hirbod hirbod renamed this gist Oct 27, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @hirbod hirbod created this gist Oct 27, 2024.
    22 changes: 22 additions & 0 deletions LeanText.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    import { type ComponentType, createElement, forwardRef } from 'react'
    import type { TextProps } from 'react-native'

    // uncomment for NativeWind support
    //import { cssInterop } from 'nativewind'


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

    LeanText.displayName = 'RCTText'

    /* uncomment this if you use NativeWind
    cssInterop(LeanText, {
    className: {
    target: 'style',
    },
    })
    */

    export { LeanText }
    22 changes: 22 additions & 0 deletions LeanView.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    import { type ComponentType, createElement, forwardRef } from 'react'
    import type { ViewProps } from 'react-native'

    // uncomment for NativeWind support
    //import { cssInterop } from 'nativewind'


    const LeanView = forwardRef((props, ref) => {
    return createElement('RCTView', { ...props, ref })
    }) as ComponentType<ViewProps>

    LeanView.displayName = 'RCTView'

    /* uncomment this if you use NativeWind
    cssInterop(LeanView, {
    className: {
    target: 'style',
    },
    })
    */

    export { LeanView }