You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am debugging a react-native application and there's an action that I can't, for the life of me, figure out where is being dispatched from?
As this is the first time I am using redux-devtools, so I am not sure if the dispatched actions have a stack trace as well? If yes, where do I check that?
If not, any tips on how do I debug this one?
Here's the component that's dispatching FINISH_INTERVENTION:
import React from 'react'
import { View, Text, ImageBackground } from 'react-native'
import Style from './InterventionCompleteScreenStyle'
import { connect } from 'react-redux'
import { isLoggedIn, submittingAnswers, answersSubmittedSuccessfully, answersSubmissionError } from '../../Stores/ARC/Selectors'
import ARCActions from 'App/Stores/ARC/Actions'
import Images from 'App/Theme/Images'
class InterventionCompleteScreen extends React.Component {
constructor(props) {
super(props)
}
componentDidMount() {
let answers = null
let type = null
let startDate = null
if (this.props.navigation !== null) {
if (this.props.navigation.getParam('answers')) {
answers = this.props.navigation.getParam('answers')
} else {
answers = []
}
if (this.props.navigation.getParam('startDate')) {
startDate = this.props.navigation.getParam('startDate')
}
if (this.props.navigation.getParam('interventionType')) {
type = this.props.navigation.getParam('interventionType')
}
}
this.props.finishIntervention()
console.log('calling submitaswers')
this.props.submitAnswers(answers, this.props.authToken, type, startDate)
}
render() {
return (
<View style={Style.container}>
<ImageBackground
source={Images.messagesBg}
resizeMode="cover"
style={Style.mainBg}
>
<View style={Style.mainContentContainer}>
<View style={Style.contentContainer}>
</View>
</View>
</ImageBackground>
</View>
)
}
}
const mapStateToProps = (state) => ({
authToken: isLoggedIn(state),
answersSubmissionError: answersSubmissionError(state),
answersSubmittedSuccessfully: answersSubmittedSuccessfully(state),
submittingAnswers: submittingAnswers(state),
})
const mapDispatchToProps = (dispatch) => ({
submitAnswers: (answers, authToken, type, timestamp) => dispatch(ARCActions.submitAnswers(answers, authToken, type, timestamp)),
finishIntervention: () => dispatch(ARCActions.finishIntervention()),
})
export default connect(
mapStateToProps,
mapDispatchToProps
)(InterventionCompleteScreen)
The text was updated successfully, but these errors were encountered:
Never mind the whole question, I figured out my mistake after 3 hours.
But I'd still love to know how to check the stack trace of the dispatched action or even there's anything like that in redux-devtools?
Any other package, that would integrates well with redux-devtools for this purpose would be nice to look at as well. 🙂
I am debugging a react-native application and there's an action that I can't, for the life of me, figure out where is being dispatched from?
As this is the first time I am using redux-devtools, so I am not sure if the dispatched actions have a stack trace as well? If yes, where do I check that?
If not, any tips on how do I debug this one?
Here's the component that's dispatching
FINISH_INTERVENTION
:The text was updated successfully, but these errors were encountered: