score:2

Accepted answer

I encountered the same problem when I was trying to pass undefined as the input value.

To fix this, ensure that you are passing at least empty string to the input, not undefined

const Field = ({ field, onFieldChange, value }) => (
  <input 
    value={value || ''} // <- add fallback value here
    onChange={(event) => { onFieldChange(field, event.target.value) }} 
    type="text" 
  />
)

score:1

  1. Actually you might try to make your component statefull - store and manage value of input inside of it (they say it's ok).
  2. Or if you really need this value in the store use redux-form, I have realy good experience of using it (you'll have to write less boilerplate code). By the way, you will not have to use any custom plugin, you can use initialValues, see more here

The solution above will work for sure, but it doesn't seem to be nice.


Related Query

More Query from same tag