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.
fillReact should be fillRect. It’s a common typo when you’re typing fast.
Spot the Bug answer: The method name ‘fillReact’ is misspelled.
The fix:
Change ‘ctx.fillReact’ to ‘ctx.fillRect’.
Why:
The CanvasRenderingContext2D API provides a method named ‘fillRect’ for drawing a filled rectangle. ‘fillReact’ is not a valid method, which will cause a TypeError or simply not draw anything without an explicit error in some environments.
First-answer leaderboard
:: Copyright KIRUPA 2026 //--
``` ```