react-final-form icon indicating copy to clipboard operation
react-final-form copied to clipboard

useField throw error "Cannot read property 'active' of undefined"

Open hieusmiths opened this issue 5 years ago • 1 comments

Are you submitting a bug report or a feature request?

What is the current behavior?

For lazy initial value's field, I'm using the useField for register filed after API loaded. My code:

if (loading) return <Compo medias={some thing} />

Compo = (medias) => {
useField("attachmentFile", { initialValue: medias });
return null;
}

Error:

final-form.es.js:181 Uncaught (in promise) TypeError: Cannot read property 'active' of undefined
    at publishFieldState (final-form.es.js:181)
    at notifyField (final-form.es.js:739)
    at notifyFieldListeners (final-form.es.js:750)
    at notify (final-form.es.js:1082)
    at afterPromise (final-form.es.js:712)

What is the expected behavior?

Sandbox Link

No

What's your environment?

Ubuntu

Other information

hieusmiths avatar Jan 11 '21 07:01 hieusmiths

Thanks team

hieusmiths avatar Jan 11 '21 07:01 hieusmiths