Rendering a component with ternary expression
I've seen it before in react-native
.
There are 2 reasons i know of that will throw this error:
- returning
null
/undefined
(not your case i think) - spaces after the
</Text>
tag (i think this is it in your case)
So remove the spaces in the end:
<View style={container}> { this.state.loaded ? (<VictoryChart theme={VictoryTheme.material} > <VictoryArea style={{ data: { fill: "#c43a31" } }} data={this.coinHistoryData} x="cHT" y="cHTVU" domain={{ y: [0, 30000] }} /> </VictoryChart>) : (<Text> Loading..</Text>)} </View> //<--- spaces are here
So this line
: (<Text> Loading..</Text>)} </View>
Should be like this
: (<Text> Loading..</Text>)}</View>