Similar method to PureComponents in hooks?

I have constantly had a tug of war with rescript react’s functional programming methods. It’s great, but I am having a constant issue when wanting to update, let’s say, a number. Within that scope, I am pulling coordinates from a map, then updating that new number on a drag listener. Every time I do so, it rerenders everything. So, I am trying to find something similar to pure components as create react class library is a bit, not there just yet. I also would like to find a better way using just hooks or functional approach as my entire frontend will basically be rescript.

Wrap the make function in React.memo.


let make = () => <div />

let make = React.memo(make)
1 Like

Yeah I am doing that but it seems that the 3rd party lib is making dom manipulations on it’s own. Which will result in me having to attach some things to the window.

Fixed it, straight dom injection.