JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id='test'></canvas>
CSS
html,
body {
width: 100%;
height: 100%;
margin: 0px;
}
canvas {
display:block;
}
JavaScript
window.addEventListener('resize', function(e) {
test.height = window.innerHeight;
test.width = window.innerWidth;
})
var test = document.getElementById('test');
test.height = window.innerHeight;
test.width = window.innerWidth;