We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32c7419 commit 371898dCopy full SHA for 371898d
src/ReactDOM.purs
@@ -13,7 +13,7 @@ import DOM (DOM)
13
import DOM.Node.Types (Element, Node)
14
import Data.Function.Uncurried (runFn1, Fn1)
15
import Data.Maybe (Maybe(..))
16
-import Data.Nullable (toMaybe)
+import Data.Nullable (Nullable, toMaybe)
17
import React (ReactElement, ReactComponent, Ref)
18
import Unsafe.Coerce (unsafeCoerce)
19
@@ -70,5 +70,8 @@ foreign import renderToStringImpl :: Fn1 ReactElement String
70
71
foreign import renderToStaticMarkupImpl :: Fn1 ReactElement String
72
73
-refToNode :: Ref -> Maybe Node
74
-refToNode ref = toMaybe (unsafeCoerce ref)
+refToNode :: Nullable Ref -> Maybe Node
+refToNode ref = toMaybe (coerce ref)
75
+ where
76
+ coerce :: Nullable Ref -> Nullable Node
77
+ coerce = unsafeCoerce
0 commit comments