Skip to content

Commit 90855cc

Browse files
committed
Do not trigger CallbackRef when receiving a null value
1 parent 027c7ef commit 90855cc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Elmish/React/Ref.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ instance CanPassToJavaScript (Ref a)
3535
callbackRef :: forall el. Maybe el -> (Maybe el -> Effect Unit) -> Ref el
3636
callbackRef ref setRef = mkCallbackRef $ mkEffectFn1 \ref' -> case ref, Nullable.toMaybe ref' of
3737
Nothing, Nothing -> pure unit
38+
Just _, Nothing -> pure unit
3839
Just r, Just r'
3940
| eqByReference r r' -> pure unit
4041
| otherwise -> setRef $ Just r'

0 commit comments

Comments
 (0)