Hooks that watch values for triggering updates, such as useEffectN, useMemoN etc., use the equality semantics of JavaScript instead of OCaml. And since OCaml values are often "block" values, represented as arrays in JavaScript, this will almost always be reference equality, and almost never what you want. The only values that would conform to expectations, I think, are ints, floats and bools.
We ought to look into how we can offer the equality semantics users expect.
Hooks that watch values for triggering updates, such as
useEffectN
,useMemoN
etc., use the equality semantics of JavaScript instead of OCaml. And since OCaml values are often "block" values, represented as arrays in JavaScript, this will almost always be reference equality, and almost never what you want. The only values that would conform to expectations, I think, areint
s,float
s andbool
s.We ought to look into how we can offer the equality semantics users expect.