<commit_before>import React, {Component} from 'react'
import {View} from 'react-native'

export default class MetaNavigatorRender extends Component {
  render () {
    const {rootComponent, uri, NavBar, Navigator, getComponentAtTop} = this.props
    const {componentAtTop, routeStack} = getComponentAtTop(rootComponent, uri)
    const Module = componentAtTop.component

    return (
      <Navigator
        saveName='main'
        ref={this.props.setNavigator}
        initialRouteStack={routeStack.toJS()}
        configureScene={route => route.sceneConfig || Navigator.SceneConfigs.FloatFromRight}
        renderScene={(route, navigator) => {
          const Module = route.component
          return (
            <View style={{flex: 1, marginTop: route.hideNavBar ? 0 : this.props.navBarHeight}}>
              <Module {...route.props} />
            </View>
          )
        }}
        navigationBar={componentAtTop.hideNavBar ? null : NavBar}
      />
    )
  }
}

MetaNavigatorRender.propTypes = {
  NavBar: React.PropTypes.object.isRequired,
  Navigator: React.PropTypes.func.isRequired,
  getComponentAtTop: React.PropTypes.func.isRequired,
  navBarHeight: React.PropTypes.number.isRequired,<commit_msg>Use element if available for native Navigator<commit_after>import React, {Component} from 'react'
import {View} from 'react-native'

export default class MetaNavigatorRender extends Component {
  render () {
    const {rootComponent, uri, NavBar, Navigator, getComponentAtTop} = this.props
    const {componentAtTop, routeStack} = getComponentAtTop(rootComponent, uri)

    return (
      <Navigator
        saveName='main'
        ref={this.props.setNavigator}
        initialRouteStack={routeStack.toJS()}
        configureScene={route => route.sceneConfig || Navigator.SceneConfigs.FloatFromRight}
        renderScene={(route, navigator) => {
          const element = route.element
          const Module = route.component
          return (
            <View style={{flex: 1, marginTop: route.hideNavBar ? 0 : this.props.navBarHeight}}>
              {element}
              {!element && Module && <Module {...route.props}/>}
            </View>
          )
        }}
        navigationBar={componentAtTop.hideNavBar ? null : NavBar}
      />
    )
  }
}

MetaNavigatorRender.propTypes = {
  NavBar: React.PropTypes.object.isRequired,
  Navigator: React.PropTypes.func.isRequired,
  getComponentAtTop: React.PropTypes.func.isRequired,
  navBarHeight: React.PropTypes.number.isRequired,
{'fraction_non_alphanumeric': 0.1112883925009972, 'fraction_numerical': 0.0015955325089748703, 'mean_word_length': 3.0128, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1206478', 'n_tokens_mistral': 714, 'n_tokens_neox': 705, 'n_words': 142}