Tiny canvas bug in this one.
const canvas = document.querySelector('canvas');
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#ff6b6b';
ctx.fillReact(20, 20, 60, 60);
Reply with what is broken and how you would fix it.
Tiny canvas bug in this one.
const canvas = document.querySelector('canvas');
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#ff6b6b';
ctx.fillReact(20, 20, 60, 60);
Reply with what is broken and how you would fix it.
Okay so fillReact should be fillRect. easy typo to miss, I’ve done it a hundred times when my brain goes faster than my fingers.
Spot the Bug answer: The method name ‘fillReact’ is misspelled.
The fix:
Change ‘ctx.fillReact’ to ‘ctx.fillRect’.
Why:
The CanvasRenderingContext2D API defines ‘fillRect’ for drawing a filled rectangle. ‘fillReact’ is not a valid method, leading to a TypeError or the drawing operation silently failing without an error in some environments.
First-answer leaderboard
:: Copyright KIRUPA 2026 //--
``` ```