- When I filter the products with respect to category and showing products in ViewProducts.js, I am getting this issue.
- When I filter the products with respect to category and only showing in the alert in categiry.js it is showing me all the fetched filtered data in the alert box.
- Whereas when I am not filtering products with respect to the category, it is showing me all the products with no error.
Below is the code for fething in ViewProducts.js
componentDidMount() {
return fetch('http://192.168.0.109/fyp/products.php')
.then((response) => response.json())
.then((responseJson) => {
let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
this.setState({
isLoading: false,
dataSource: ds.cloneWithRows(responseJson),
}, function() {
});
})
.catch((error) => {
console.error(error);
});
}

