Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!