Closed developerZirkonzahn closed 4 years ago
Hey @developerZirkonzahn do you have any info about the crash, what the error message is?
When i run it on Expo it doesn`t thorw an error, but if i build the app on ios and run it on testflight it crashs. In the crashlog it only sasy:
Exeption Type: EXC_CRASH (SIGABRT) Exeption Note: EXC_CORPSE_NOTIFY
the onDelete
button works how it should, it only crashes when i change screen with the onInfo
button and return to the previews screen.
@developerZirkonzahn This is the first I'm ever hearing of this so I have a feeling this issue isn't related to this library, but happy to help you debug.. what's going on in the onInfo
function?
i call navigation.navigate
to navigate to the next view. nothing else
I used the old version of swipeout react-native-swipeout
and everything worked fine.
In my homescreen
i use a Flatlist:
<FlatList
data={this.state.machineList}
onRefresh={() => this.onRefresh()}
refreshing={this.state.isFetching}
keyExtractor={item => this._keyExtractor(item)}
renderItem={({ item, index }) => {
return (
<MachineListItem machine={item} index={index}
onPress={() =>
this.props.navigation.navigate('MachineDetailScreen', {
machine: item
})
}
onDelete={() => { this._removeMachine(item.unit_key) }}
onAd={() =>
this.props.navigation.navigate("AdScreen", {
link: item.link,
title: item.title
})
}
onInfo=
{() =>
this.props.navigation.navigate('MachineInfoScreen', {
image: item.machineImg
})
}
/>
)
}}
/>
I pass every Item to the class MachineListItem
, where I use SwipeRow
.
Hm I don't see anything wrong with the code. Is there anyway to run this in debug mode in Xcode and try to see more in the crash logs? Without more to go on this is tough to diagnose on this end
I rewrote my code and I use a SwipeListView now, but I get the same error. I think that's because I'm navigating to the next view and when I'm going back to SwipeListView, the row is still open. How can I close ah row when i press a button, bc when I use rowMap[rowData.item.key].closeRow()
, rowData.item.key
is undefined
.
<SwipeListView
useNativeDriver={true}
data={this.state.machineList}
onRefresh={() => this.onRefresh()}
refreshing={this.state.isFetching}
keyExtractor={item => this._keyExtractor(item)}
renderItem={this._renderItem}
renderHiddenItem={this._renderHiddenItem}
rightOpenValue={-150}
disableRightSwipe={true}
/>
_renderHiddenItem = (data) => (
<View style={styles.rowBack}>
<TouchableOpacity
style={[styles.backRightBtn, styles.backRightBtnLeft]}
onPress={() => { < --- \\ close row here, before navigate
this.props.navigation.navigate('MachineInfoScreen', {
image: data.item.machineImg,
name: data.item.name,
serial: data.item.serial,
code: data.item.unit_key,
type: data.item.type,
service: data.item.services,
timestamp: this._calculateTime(data.item.lastCallback)
})
}}
>
<Ionicons name="md-information" size={40} color='white' />
</TouchableOpacity>
</View>
);
@developerZirkonzahn can you show me where in your code you're calling rowData.item.key
, I don't see it above?
This should definitely be working, see here for a reference: https://github.com/jemise111/react-native-swipe-list-view/blob/master/SwipeListExample/examples/basic.js#L54
nvm, I could fix all my problems. thanks.
I use a Swiperow with 2 buttons, on one button i change view and when i go back to the previouse view my app crashes.