Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 926 Bytes

File metadata and controls

34 lines (26 loc) · 926 Bytes

react-native-app-helpers/createStackComponent

Creates a new React component which displays its children in a stack with a set spacing between each item.

Usage

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

const ExampleStack = createStackComponent(25, `horizontal`);

const ExampleScreen = () => (
  <ExampleStack>
    <Text>These example items are spaced 25 pixels apart.</Text>
    <Text>The line starts at the left edge of the container.</Text>
    <Text>It runs to the right.</Text>
  </ExampleStack>
);
import { createStackComponent } from "react-native-app-helpers";

const ExampleStack = createStackComponent(25, `vertical`);

const ExampleScreen = () => (
  <ExampleStack>
    <Text>These example items are spaced 25 pixels apart.</Text>
    <Text>The line starts at the top edge of the container.</Text>
    <Text>It runs to the bottom.</Text>
  </ExampleStack>
);