1.0.0 • Published 5 years ago

react-native-sort v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-native-sort

Work In Progress

Getting started

$ npm install react-native-sort --save

Mostly automatic installation

$ react-native link react-native-sort

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.reactlibrary.SortPackage; to the imports at the top of the file
  • Add new SortPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-sort'
    project(':react-native-sort').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-sort/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-sort')

Usage

import Sort from 'react-native-sort';

const data=["Akrafjall","Bláfjöll","Blönduós","Akureyri","Austurárdalsháls","Básar á Goðalandi","Biskupsháls","Bíldudalur","Bjargtangar","Bjarnarey","Bláfjallaskáli","Blönduós Vegagerðarstöð","Botnsheiði","Brattabrekka","Breiðdalsheiði","Brú á Jökuldal","Árnes","Ásbyrgi","Ásgarður"];

const SortedData = Sort.it(data);