After reviewing the documentation, I believed that the optimal solution in later versions of material-ui was to use useMediaQuery
, but unfortunately, I am unable to implement it correctly. My objective is to hide a menu when the page is being printed, so I attempted something along the lines of:
if (!useMediaQuery("print")) {
... code to be hidden
}
Although this compiles and executes without errors, it doesn't achieve the desired result. It appears that the component is not rendered when the browser enters print preview mode (FF 65).
Does anyone have any suggestions on how to accomplish this?