🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

react-native-order-children

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-order-children

Orders the children of the component by the "order" prop unless otherwise defined by providing it with a prop "by"

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

React Native - Order Children

Overview

A simple React Native Component which allows you to re-order the children by a given prop. By default it will order by the prop "order." This can also be used in conjunction with absolute positioning to give a very basic Z-Index capability to React Native.

Available Props

  • by (default: 'order') - Allows you to define the key that each child should by ordered by.
  • direction (default: 'column') - Choose 'row' or 'column' to define what direction the views should be ordered in.
  • style (default: '') - Define extra styling which can be used to style the wrapper view of the children.

Example

var Order = require('react-native-order-children');
var React = require('react-native');

var ExampleComponent = React.createClass({
  render() {
    return (
        <Order>
            <View order={2}>
                <Text> 1 </Text>
            </View>
            <View order={1}>
                <Text> 2 </Text>
            </View>
        </Order>
    );
  },

});

module.exports = ExampleComponent;

Keywords

react-native

FAQs

Package last updated on 13 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts