react-native-complete-flatlist
Advanced tools
Comparing version 1.1.25 to 1.1.26
@@ -65,2 +65,3 @@ import React, { Component } from "react"; | ||
const row = {}; | ||
row.cleanData = dt | ||
const keys = Object.keys(dt); | ||
@@ -84,3 +85,3 @@ for (let i = 0; i < keys.length; i += 1) { | ||
} | ||
return filteredData; | ||
return filteredData | ||
}; | ||
@@ -87,0 +88,0 @@ |
{ | ||
"name": "react-native-complete-flatlist", | ||
"version": "1.1.25", | ||
"version": "1.1.26", | ||
"description": "A complete flatlist with search bar, highlighted search, pull to refresh, and etc is ready to use", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,2 +6,13 @@ # react-native-complete-flatlist | ||
Caution: | ||
```renderItem``` props return ```data``` and ```index``` parameters | ||
```data``` parameter returns a single element in ```data``` array. But if search text is not empty, ```data``` parameter will return new structure of JSON object (in order to render highlighted text in jsx). This might break your logic. Therefore, if you want to access original structure of your data, it will be under ```data.cleanData```. Remember, ```data.cleanData``` only exist if search text is not empty (user is searching) | ||
Usage : | ||
@@ -42,3 +53,5 @@ | ||
class App extends Component { | ||
cell(data,index) { | ||
cell = (data,index) => { | ||
console.log(data.cleanData) | ||
console.log('data.cleanData will be not null if search bar is not empty. caution, data without search is not same like data with search due to implement the highlight component. data.cleanData is equal to data') | ||
console.log('this is index number : '+index) | ||
@@ -59,3 +72,3 @@ return <Text>{data.name}</Text>; | ||
renderSeparator={null} | ||
renderItem={this.cell.bind(this)} | ||
renderItem={this.cell} | ||
/> | ||
@@ -62,0 +75,0 @@ ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13864
214
98