title: Using custom functions in react
body: <p>I have a component like this</p>
  
  <pre><code>class Hourly extends Component {
    render() {
      return (
        &lt;div key={this.props.key} id={this.props.id} className="col-xs-3 text-center vcenter box parent"&gt;
          &lt;div className="child"&gt;
            &lt;div&gt;{this._theDay(this.props.day)}&lt;/div&gt;
            &lt;div&gt;{this.props.summary}&lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>
  
  <p>I want to use a custom function (_theDay) in the component which i use later in another component</p>
  
  <p>Custom function:</p>
  
  <pre><code>_theDay(time) {
     moment.locale('en-gb');
     var dateTime = moment(time*1000).format('dddd');
     return dateTime;
    }
  </code></pre>
  
  <p>I call the component later with</p>
  
  <pre><code>        &lt;Hourly
            key={hour.time}
            id={hour.time}
            day={hour.time}
            summary={hour.summary}
          /&gt;
  </code></pre>
  
  <p>However i get the error: <code>Uncaught (in promise) DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.(…)</code></p>
  
  <p>When i just use <code>&lt;div&gt;{this.props.day}&lt;/div&gt;;</code> everything works fine, but then i can't use my custom function</p>