import React, { Component } from 'react';

class SetInput extends Component {
  componentDidMount() {
    const { input, setValue } = this.props;
    input.onChange(setValue);
  }

  shouldComponentUpdate(nextProps) {
    const { input, setValue } = this.props;
    if (setValue !== nextProps.setValue) {
      input.onChange(nextProps.setValue);
    }
    return false;
  }

  render() {
    return null;
  }
}

export default SetInput;
