code: function setNativeValue(element, value) {
    const {set: valueSetter} =
      Object.getOwnPropertyDescriptor(element, 'value') || {}
    const prototype = Object.getPrototypeOf(element)
    const {set: prototypeValueSetter} =
      Object.getOwnPropertyDescriptor(prototype, 'value') || {}
    if (prototypeValueSetter && valueSetter !== prototypeValueSetter) {
      prototypeValueSetter.call(element, value)
    } /* istanbul ignore next (I don't want to bother) */ else if (valueSetter) {
      valueSetter.call(element, value)
    } else {
      throw new Error('The given element does not have a value setter')
    }
  }
docs: function written after some investigation here: https://github.com/facebook/react/issues/10135#issuecomment-401496776