Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
Conditional Logic on an array not working correctly - React Native

I am trying to only create a view component when the array has data. The array starts off empty - it is filled via API upon click of the item. Some items have data from this API endpoint and others do not have any values it returns as Object [[Prototype]]: Object No matter what conditional I do it does not work.

I am trying to only let this view be created if that endpoint has data for that array if it does not do not create the view.

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>
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda