@@ -40,26 +40,14 @@ module Interop =
4040 | _ -> value.ToString() |> ViewBuilder.escape
4141 KeyValue ( key, result)
4242
43- let inline mkStyle ( key : string ) ( value : obj ) : IStyleAttribute = Style ( key , value ) :> _
44-
45- type FunctionComponent < 'Props > = 'Props -> ReactElement
43+ let mkEventHandler ( name : string ) ( handler : obj -> unit ) : IReactProperty =
44+ let event = EventHandlerType.Event ( handler )
45+ IReactProperty.KeyValue ( name , event )
4646
47- // fsharplint:disable
47+ let mkEventHandlerWithKey name key ( handler : obj -> unit ) =
48+ let keyEvent = EventHandlerType.KeyEvent( key, handler)
49+ IReactProperty.KeyValue( name, keyEvent)
4850
49- type Event () = class end
50- with
51- member x.preventDefault () = ()
52- member x.type ' = " Event"
51+ let inline mkStyle ( key : string ) ( value : obj ) : IStyleAttribute = Style ( key, value) :> _
5352
54- type AnimationEvent () = inherit Event ()
55- type ClipboardEvent () = inherit Event ()
56- type CompositionEvent () = inherit Event ()
57- type DragEvent () = inherit Event ()
58- type IKeyboardKey = interface end
59- type KeyboardEvent () = inherit Event ()
60- type FocusEvent () = inherit Event ()
61- type MouseEvent () = inherit Event ()
62- type TouchEvent () = inherit Event ()
63- type TransitionEvent () = inherit Event ()
64- type WheelEvent () = inherit Event ()
65- type File = class end
53+ type FunctionComponent < 'Props > = 'Props -> ReactElement
0 commit comments