Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 899 Bytes

File metadata and controls

41 lines (33 loc) · 899 Bytes

react-native-app-helpers/createTextComponent

Creates a new React component which can be used to render text.

Usage

import { createTextComponent } from "react-native-app-helpers";

const ExampleText = createTextComponent(`example`, `red`, 12, `left`, false);

const ExampleScreen = () => (
  <ExampleText>
    Hello World! (
      in the "example" font,
      in red,
      at size 12,
      left-aligned,
      truncates with ellipsis rather than wrapping
    )
  </ExampleText>
);
import { createTextComponent } from "react-native-app-helpers";

const ExampleText = createTextComponent(`example`, `red`, 12, `left`, true);

const ExampleScreen = () => (
  <ExampleText>
    Hello World! (
      in the "example" font,
      in red,
      at size 12,
      left-aligned,
      wraps over multiple lines when the available width is exceeded
    )
  </ExampleText>
);