I am trying to create a basic stopwatch app, I'd like to tidy up my render function by putting markup into different methods, like this:
export default class stopwatch extends Component { render() { return <View style={styles.container}> <View style ={[styles.header, this.border('yellow')]}> <View style={this.border('red')} > <Text> 00.00.00 </Text> </View> <View style={this.border('green')} > {this.startStopButton()} {this.lapButton()} </View> </View> <View styles={[style.footer, this.border('blue')]}> <Text> List of Laps </Text> </View> }, I'd like to tidy up my render function by putting markup into different methods, like this:
startStopButton: function(){ return <View> <Text> Start </Text> </View> }, lapButton: function(){ return <View> <Text> Lap </Text> </View> } }; However, I keep getting the error, Unexpected Toekn line 27 which is this line
startStopButton: function(){ return <View> Any ideas whats wrong with it?