1.0.0 • Published 6 years ago
react-native-sort v1.0.0
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
- 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 thegetPackages()method
- 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') - 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);1.0.0
6 years ago