I have the following component:
import { identity } from 'lodash';
export const Input = ({
onChange = identity
//etc.
}: {
onChange: Event<HTMLInputElement>,
}) => <Input onChange={onChange} />
But when I run flow I get this error:
onChange = identity,
^^^^^^^^^^^^^^^^^^^ default value. Expected polymorphic type instead of
onChange = identity,
^^^^^^^^ class type: Event
I'm confused as to where to find the definition for Event.
If I look at facebook's dom types:
I can see Event here which has a target property of type EventTarget.
But looking at the EventTarget definition, I don't see any definiton for value.
I don't see to define the synthetic event so that it has a target of type HtmlInputElement.