Open chenglou opened 7 years ago
Element
has asHtmlElement
and HtmlElement
has value
.
So if it returns an element
:
event
|> ReacEventRe.Form.target
|> Element.asHtmlElement
|> Option.unwrapUnsafely
|> HtmlElement.value
Pretty smooth, huh :D
I'm on my way to bed. Talk to you tomorrow.
If it returns an eventTarget you're screwed. Unsafe way is only way. C'est la vie
@glennsl (since discord is down again. Also, I'm on freenode #reasonml)
Assuming
ReactEventRe.Form.target event
returnsReasonJs.Dom.element
orReasonJs.Dom.eventTarget
, what reason-js function do I use to get the equivalent ofmyEvent.value
? How would it work without unsafe cast to whatever type here?