I want to execute all lines inside if statement but I can't
this is my code
import React, { Component } from 'react';
import { Text, View } from 'react-native';
class test extends Component {
constructor() {
super();
this.state = { data: [] };
}
testFunction = () => {
return (
<View>
<Text>Anything</Text>
</View>
);
};
render() {
return (
<View>{data.length > 0 ? <Text>Hi</Text> : this.testFunction() <Text>Hello</Text>}</View>
);
}
}
export default test;
I want to execute (this.testFunction()
) and (<Text>Hello</Text>
)
thank you