Skip to content

Instantly share code, notes, and snippets.

@jtenner
Created December 22, 2016 19:41
Show Gist options
  • Save jtenner/928baadad40383645e020958238e6c8c to your computer and use it in GitHub Desktop.
Save jtenner/928baadad40383645e020958238e6c8c to your computer and use it in GitHub Desktop.
let canvas = document.createElement('canvas');
canvas.width = 800;
canvas.height = 600;
//get the canvas context
let ctx = canvas.getContext('2d');
//add it to the dom
document.body.appendChild(canvas);
e2d.raf(
() => <render ctx={ctx}>
<clearRect width={800} height={800} />
<fillText text="Hello World!" x={100} y={100} />
</render>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment