i’m working on react native expo project, i’m trying to reassign value to state on class component on componentDidMount() using switch statement i 6 user journey so this is why i cant not use if statement
async componentDidMount() {
this.state.accessToken = await token.get();
// Setp Global State
let finalSteps = 1;
switch(finalSteps){
case accessToken ? && this.props.navigation.getParam('search_type') == 3 :
{ return finalSteps = 11}
case ( accessToken ? && this.props.navigation.getParam('requestType') == 1) {
finalSteps = 6
}
...
case (!accessToken) {
finalSteps = 3
}
}
dispatch(setDefaultStepsNumber(finalSteps))
}
is the switch statement right way on my code switch(final Steps) i have too many condition each one i want return different value of finalSteps ? it seems the is syntax error