Hi all,
I’ve managed to get myself into a corner. I have a large, complicated React component that I’d like to squirrel away in its own module. And, because it’s large and complicated, I would very much like to memoize it, using a custom comparator to check whether the props that I actually care about have changed.
Because the component is complicated, I would very much like to provide a .resi file where I can provide the type, and some documentation. I cannot work out how to convince Rescript that the types are fine; pretty sure it’s something to do with monomorphic types creeping in, even though it should be completely polymorphic. I’ve linked to a tiny example.
How can I work around this weird monomorphisation issue? It works great without memoizing using the custom prop comparer.
Thanks for any help!