/* @flow */

import React from 'react'
import { View, Text, SectionList, StyleSheet, TouchableHighlight } from 'react-native'

export default class Calendar extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      highlight: false
    }
  }
  
  _renderHighlight = () => {
    this.setState({highlight: !this.state.highlight})
  }
  
  _renderItem = ({item}) => {
    return (
      <View key={item}>
        <Text key>
          {item.title}
        </Text>
      </View>
    )
  }

  render () {
    let active
    if (this.state.highlight) {
      active = {
        backgroundColor: '#d3d3d3'
      }
    }
    return (
      <View style={styles.container}>
        <SectionList
          keyExtractor={(item) => item.title}
          SectionSeparatorComponent={() =>
            <View style={{height: 1, backgroundColor: 'red'}} />
          }
          sections={[ // heterogeneous rendering between sections
            {data: [{'title': 'apple'}], key: 'dog', renderItem: this._renderItem},
            {data: [{'title': 'homie'}, {'title': 'dog'}], key: 'hello', renderItem: this._renderItem},
            {data: [{'title': 'lets do it'}, {'title': 'whatup'}], key: 'month', renderItem: this._renderItem}
          ]}
        />
        <TouchableHighlight
          onPress={this._renderHighlight}
          underlayColor={'d3d3d3'}
        >
          <Text>
            my dude
          </Text>
        </TouchableHighlight>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    top: 20
  }
})

@@ -264,27 +264,25 @@
 e%0A    %7D%0A  %7D%0A
-  
 %0A
+
   _renderHig
@@ -360,11 +360,9 @@
   %7D%0A
-  
 %0A
+
   _r
@@ -868,24 +868,64 @@
           %7D%0A
+          renderItem=%7Bthis._renderItem%7D%0A
           se
@@ -1033,38 +1033,8 @@
 dog'
-, renderItem: this._renderItem
 %7D,%0A 
@@ -1107,38 +1107,8 @@
 llo'
-, renderItem: this._renderItem
 %7D,%0A 
@@ -1189,38 +1189,8 @@
 nth'
-, renderItem: this._renderItem
 %7D%0A  
@@ -1281,16 +1281,16 @@
 hlight%7D%0A
-
         
@@ -1307,16 +1307,17 @@
 Color=%7B'
+#
 d3d3d3'%7D

Change to static renderItem