We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
unsafeEventFn
1 parent c6ae2e2 commit 2f0b68eCopy full SHA for 2f0b68e
src/React/Basic/Events.purs
@@ -37,8 +37,11 @@ foreign import data SyntheticEvent :: Type
37
-- | ```
38
newtype EventFn a b = EventFn (a -> b)
39
40
--- | Unsafely create an `EventFn`. This function should be avoided.
41
--- | Use the helper functions specific to your platform (such as `React.Basic.DOM.Events`).
+-- | Unsafely create an `EventFn`. This function should be avoided as it can allow
+-- | a `SyntheticEvent` to escape its scope. Accessing a React event's properties is only
42
+-- | valid in a synchronous event callback.
43
+-- |
44
+-- | Instead, use the helper functions specific to your platform, such as `React.Basic.DOM.Events`.
45
unsafeEventFn :: forall a b. (a -> b) -> EventFn a b
46
unsafeEventFn = EventFn
47
0 commit comments