<commit_before>import React, { Component } from 'react'
import PropTypes from 'prop-types'

class Rail extends Component {
  render() {
    const { children, emitMouse, emitTouch } = this.props

    const renderedChildren = children({ emitMouse, emitTouch })
    return renderedChildren && React.Children.only(renderedChildren)
  }
}

Rail.propTypes = {
  /** @ignore */<commit_msg>add getRailProps<commit_after>import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { callAll } from '../utils'

class Rail extends Component {
  getRailProps = (props = {}) => ({
    ...props,
    onMouseDown: callAll(props.onMouseDown, this.emitMouse),
    onTouchStart: callAll(props.onTouchStart, this.emitTouch),
  })

  emitMouse = e => {
    this.props.emitMouse(e)
  }

  emitTouch = e => {
    this.props.emitTouch(e)
  }

  render() {
    const { children, emitMouse, emitTouch } = this.props

    const renderedChildren = children({
      emitMouse,
      emitTouch,
      getRailProps: this.getRailProps,
    })
    return renderedChildren && React.Children.only(renderedChildren)
  }
}

Rail.propTypes = {
  /** @ignore */
{'fraction_non_alphanumeric': 0.12827225130890052, 'fraction_numerical': 0.0, 'mean_word_length': 3.4980392156862745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '7439626', 'n_tokens_mistral': 356, 'n_tokens_neox': 345, 'n_words': 80}