// @flow
const React = require("react");
const { PropTypes } = React;

let markerEl = document.createElement("div");

function makeMarker() {
  let marker = markerEl.cloneNode(true);
  marker.className = "editor hit-marker";
  return marker;
}

const HitMarker = React.createClass({
  propTypes: {
    hitData: PropTypes.object.isRequired,
    editor: PropTypes.object.isRequired
  },

  displayName: "HitMarker",

  addMarker() {
    const hitData = this.props.hitData;
    const line = hitData.line - 1;

    this.props.editor.setGutterMarker(
      line,
      "hit-markers",
      makeMarker()
    );

    this.props.editor.addLineClass(line, "line", "hit-marker");
  },

  shouldComponentUpdate(nextProps: any) {
    return this.props.editor !== nextProps.editor ||
      this.props.hitData !== nextProps.hitData;
  },

  componentDidMount() {
    if (!this.props.editor) {
      return;
    }

    this.addMarker();
  },

  componentDidUpdate() {
    this.addMarker();
  },

  componentWillUnmount() {
    if (!this.props.editor) {
      return;
    }

    const hitData = this.props.hitData;
    const line = hitData.line - 1;

    this.props.editor.setGutterMarker(line, "hit-markers", null);
    this.props.editor.removeLineClass(line, "line", "hit-marker");
  },

  render() {
    return null;
  }
});

module.exports = HitMarker;

@@ -239,20 +239,20 @@
 er;%0A%7D%0A%0Ac
-onst
+lass
  HitMark
@@ -258,160 +258,32 @@
 ker 
-= React.createClass(%7B%0A  propTypes: %7B%0A    hitData: PropTypes.object.isRequired,%0A    editor: PropTypes.object.isRequired%0A  %7D,%0A%0A  displayName: %22HitMarker%22,
+extends React.Component%7B
 %0A%0A  
@@ -534,25 +534,24 @@
 arker%22);%0A  %7D
-,
 %0A%0A  shouldCo
@@ -682,25 +682,24 @@
 hitData;%0A  %7D
-,
 %0A%0A  componen
@@ -780,33 +780,32 @@
 addMarker();%0A  %7D
-,
 %0A%0A  componentDid
@@ -836,25 +836,24 @@
 arker();%0A  %7D
-,
 %0A%0A  componen
@@ -1132,17 +1132,16 @@
 r%22);%0A  %7D
-,
 %0A%0A  rend
@@ -1169,17 +1169,163 @@
 l;%0A  %7D%0A%7D
-)
+%0A%0AHitMarker.propTypes = %7B%0A  hitData: PropTypes.object.isRequired,%0A      editor: PropTypes.object.isRequired%0A%7D;%0A%0AHitMarker.displayName = %22HitMarker%22
 ;%0A%0Amodul

Update HitMarker.js