Skip to content

Commit 1b0d542

Browse files
author
Marcin Szamotulski
committed
Nullable Ref in withRefs
1 parent dc2b66a commit 1b0d542

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/React.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ readRef this name = toMaybe <$> readRefImpl this name
321321
foreign import writeRef :: forall props state access eff.
322322
ReactThis props state ->
323323
String ->
324-
Ref ->
324+
Nullable Ref ->
325325
Eff (refs :: ReactRefs (write :: Write | access) | eff) Unit
326326

327327
-- | Read the component children property.

src/React/DOM/Props.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module React.DOM.Props where
22

33
import Control.Monad.Eff (Eff)
44
import Control.Monad.Eff.Unsafe (unsafePerformEff)
5+
import Data.Nullable (Nullable)
56
import Prelude (Unit, (<<<))
67
import React (Event, EventHandlerContext, KeyboardEvent, MouseEvent, ReactRefs, Ref, Write, handle)
78

@@ -309,7 +310,7 @@ ref = unsafeMkProps "ref"
309310
-- | ```
310311
withRef
311312
:: forall access eff
312-
. (Ref -> Eff (refs :: ReactRefs (write :: Write | access) | eff) Unit)
313+
. (Nullable Ref -> Eff (refs :: ReactRefs (write :: Write | access) | eff) Unit)
313314
-> Props
314315
withRef cb = unsafeMkProps "ref" (unsafePerformEff <<< cb)
315316

0 commit comments

Comments
 (0)