JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="canvas"></canvas>
JavaScript
var $;
window.onload = function(){
$ = {
ratio: 0.7,
screen: 500,
margin: 10,
canvas: document.getElementById("canvas"),
ctx: document.getElementById("canvas").getContext("2d")
};
console.log($.canvas);
console.log($.ctx);
};