Estoy tratando de crear solo un componente de vista cuando la matriz tiene datos. La matriz comienza vacía: se llena a través de la API al hacer clic en el elemento. Algunos elementos tienen datos de este punto final de API y otros no tienen ningún valor que devuelva como Object [[Prototype]]: Object No importa qué condicional haga, no funciona.
Estoy tratando de dejar que se cree esta vista solo si ese punto final tiene datos para esa matriz si no crea la vista.
this.state = { cryptoTradingSignals: [], } fetchCryptoStats(selectedCrypto) { getCryptoTradingSignals(selectedCrypto).then(cryptoTradingSignal => this.setState({cryptoTradingSignals: cryptoTradingSignal}), ); } {this.state.cryptoTradingSignals.length !== 0 && this.state.cryptoTradingSignals && this.state.cryptoTradingSignals !== undefined && this.state.cryptoTradingSignals !== null ? ( <View style={{ flex: 1, alignItems: 'center', paddingBottom: 30, }}> <Text style={styles.sectionHeader}> Market Signals </Text> <Box style={{margin: 5}} width="80%" bg="white" p="5" shadow={2} rounded="md" _text={{ fontSize: 'md', fontWeight: 'bold', color: 'black', }}> <View style={{flexDirection: 'column'}}> <Text style={styles.marketSentimentTitle}> In The Money Signal </Text> <Text> Category:{' '} {this.state.cryptoTradingSignals .inOutVar.category ? 'not available' : null} </Text> <Text> Sentiment:{' '} { this.state.cryptoTradingSignals .inOutVar.sentiment } </Text> </View> </Box>