ReasonReact get window width


I am a bit stumped while trying to get the current window width out of ReactDOMRe. I am trying to use the ReactDOMRe.widthGet function but that needs a correct props record type passed to it. However, I seem unable to find a function that returns that props object. Should be something simple I’d guess but I don’t seem to be able to do it.


So apparently it is best to use bs-webapi,
let window = Webapi.Dom.window; to get the window and then
Webapi.Dom.Window.innerWidth(window) to e.g. get the innerwidth of the window