import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
import Odometer from 'odometer';

export default class ReactOdometer extends Component {
  static propTypes = {
    value: PropTypes.number.isRequired,
    options: PropTypes.object,
  };

  componentDidMount() {
    this.odometer = new Odometer({
      el: ReactDOM.findDOMNode(this),
      value: this.props.value,
      ...this.props.options,
    });
  }

  componentDidUpdate() {
    this.odometer.update(this.props.value);
  }

  render() {
    return React.createElement('div');
  }
}

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Odometer from 'odometer';

export default class ReactOdometer extends Component {
  static defaultProps = {
    options: {},
  };

  static propTypes = {
    value: PropTypes.number.isRequired,
    options: PropTypes.object,
  };

  componentDidMount() {
    const { value, options } = this.props;
    this.odometer = new Odometer({
      el: this.node,
      value,
      ...options,
    });
  }

  componentDidUpdate() {
    this.odometer.update(this.props.value);
  }

  render() {
    return React.createElement('div', {
      ref: (node) => {
        this.node = node;
      },
    });
  }
}

Use ref instead of findDOMNode
Use ref instead of findDOMNode
