JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="myCanvas"></canvas>
JavaScript
// Récupérer le contexte du canvas:
var canvas = document.getElementById('myCanvas'),
context = canvas.getContext('2d');
// Dessiner sur le canvas:
context.fillStyle = '#666666';
for (var i = 0; i < 10000; i++)
context.fillRect(
Math.floor(Math.random() * canvas.width),
Math.floor(Math.random() * canvas.height),
1,
1
);