Unable to access React instance (this) inside event handler

I am writing a simple component in ES6 (with BabelJS), and functions this.setState is not working.

Typical errors include something like

Cannot read property ‘setState’ of undefined


this.setState is not a function

Do you know why? Here is the code:

import React from 'react'

class SomeClass extends React.Component {
  constructor(props) {
    this.state = {inputContent: 'startValue'}

  sendContent(e) {
    console.log('sending input content '+React.findDOMNode(React.refs.someref).value)

  changeContent(e) {
    this.setState({inputContent: e.target.value})

  render() {
    return (
        <h4>The input form is here:</h4>
        <input type="text" ref="someref" value={this.inputContent} 
          onChange={this.changeContent} /> 
        <button onClick={this.sendContent}>Submit</button>

export default SomeClass

Source: ReactJs