diff --git a/packages/inferno-mobx/__tests__/types.spec.tsx b/packages/inferno-mobx/__tests__/types.spec.tsx index 255c99761..ab02615bf 100644 --- a/packages/inferno-mobx/__tests__/types.spec.tsx +++ b/packages/inferno-mobx/__tests__/types.spec.tsx @@ -1,4 +1,4 @@ -import { Component, render } from 'inferno'; +import { Component, FormEvent, render } from 'inferno'; import { Provider } from 'inferno-mobx'; import { observable } from 'mobx'; @@ -44,6 +44,10 @@ describe('top level context', () => { render(, container); }); + it('Should not complain about onInput event.target', () => { + render() => e.target.value} />, container); + }) + it('Should be possible to return null from render SFC', () => { // SFC const MyComponent = () => { diff --git a/packages/inferno/src/core/types.ts b/packages/inferno/src/core/types.ts index d5fc60874..6fe6345d9 100644 --- a/packages/inferno/src/core/types.ts +++ b/packages/inferno/src/core/types.ts @@ -76,7 +76,9 @@ export type ClipboardEvent = SemiSyntheticEvent & NativeClipboardEvent; export type CompositionEvent = SemiSyntheticEvent & NativeCompositionEvent; export type DragEvent = InfernoMouseEvent & NativeDragEvent; export type FocusEvent = SemiSyntheticEvent & NativeFocusEvent; -export type FormEvent = SemiSyntheticEvent; +export interface FormEvent extends SemiSyntheticEvent { + target: EventTarget & T; +} export interface ChangeEvent extends SemiSyntheticEvent { target: EventTarget & T;