null is not an object evaluting this.rows[this.opencelld]._root
See original GitHub issuereact-native:“0.53.0” , react and native-base version:“^2.3.8”
Expected behaviour
It should be delete row
Actual behaviour
whenever try to delete first row it throws 'null is not an object evaluting
this.rows[this.opencelld]._root’ error
safeCloseOpenRow
E://abc/proj/node_modules\native-base\dist\src\basic\List.js:57:13
Steps to reproduce (code snippet or screenshot)
-
add two or three items in swipable list using array
-
then delete from bottom
-
in the last delete first one
-
(it will throw above error)
<List style={{ width: width }}
dataSource={this.ds.cloneWithRows(this.state.expenseList)}
renderRow={data =>
<ListItem style={{ paddingTop: 10, paddingBottom: 10 }}>
<Body style={{ paddingLeft: 15, paddingRight: 15 }}>
<Text style={{ color: '#009688', fontWeight: 'bold' }}>{data.item_name}</Text>
</Body>
<Right>
<Text style={{ fontWeight: 'bold' }}>{data.expense_amount} </Text>
</Right>
</ListItem>
}
renderLeftHiddenRow={(data, secId, rowId) =>
<Button full danger onPress={() => this.deleteExpense(data, secId, rowId)}>
<Text style={{ color: '#fafafa' }}>Delete</Text>
</Button>}
renderRightHiddenRow={(data, secId, rowId, rowMap) =>
<Button full onPress={() => this.editExpense(data, secId, rowId, rowMap)}>
<Text style={{ color: '#fafafa' }}>Edit</Text>
</Button>}
leftOpenValue={75}
rightOpenValue={-75}
/>
delete function :
deleteExpense = (data, secId, rowId) => {
let arr = this.state.expenseList;
let expenseId = data._id;
console.log("row Id", rowId);
let obj = {
expenseId: expenseId
}
ExpenseProvider.deleteExpense(obj)
.then(data => {
if (data.success === true) {
// eventObj.emit("updateExpense");
arr.splice(rowId, 1);
console.log("arr",JSON.stringify(arr));
this.setState({ expenseList: arr });
} else {
}
})
}
Screenshot of emulator/device
Is the bug present in both ios and android or in any one of them?
Any other additional info which would help us debug the issue quicker.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
TypeError: null is not an object (evaluating ''this.state.torchon')
You have not initialized the state anywhere and when you access this.state.torchon it throws the error because this.state is null.
Read more >TypeError: null is not an object (evaluating ... - GitHub
Using the appcenter-analytics in the React Native project. we got the below mention error in the Android platform but in iOS its working...
Read more >null is not an object (evaluating 'RNZipArchive.unzip') - Reddit
Can someone help me with it? i've try to use in android, i didn't test in IOS yet. I can't unzip and zip...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Arpan2912 tried a similar code. It is working fine.
Code
Gif
Isolating every line of code didn’t help. But re-installing dependencies did.