JSFiddle - React, Tailwind, and code Playground
HTML
<div id="screenSize"/>
JavaScript
function getScreenSizeInches() {
var $temp = $('<div style="overflow:hidden;visibility:hidden;width:10in"/>').appendTo('body'),
dpi = $temp[0].offsetWidth / 10;
return screen.width / dpi + 'x' + screen.height / dpi;
}
$('#screenSize').text(getScreenSizeInches());