Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How can I improve this? using typescript

$
0
0
const ProgressBarVertical: React.FC<ProgressProps> = ({  Levelorder,  currentLevel, }) => {  if (Levelorder === 0) {       switch (currentLevel) {         case 0:           return <View style={styles.progressIncompleteFirst} />         default:           return <View style={styles.progressCompleteFirst} />       }  } else if (Levelorder > currentLevel) {     return <View style={styles.progressIncomplete} />  } else if (Levelorder < currentLevel) {     return <View style={styles.progressComplete} />  } else {     return <View style={styles.progressIncomplete} />  }

I'm was in a rush and I did my conditions like this, But I feel I still can improve this. Can someone show me how?


Viewing all articles
Browse latest Browse all 6287

Trending Articles