๐ I accidentally fixed my React performance with one script tag
Sometimes the best performance wins come from tools you didnโt plan to use.
๐ I accidentally fixed my React performance with one script tag

Sometimes the best performance wins come from tools you didnโt plan to use.
In my case, it was this one
<script src="https://cdn.jsdelivr.net/npm/react-scan/dist/auto.global.js"></script>
Yes, seriously.
๐ค The problem: โWhy is everything re-rendering?โ
I was working on a fairly standard React app โ tables, filters, some global state, nothing crazy.
But something felt off:
- UI updates were sluggish
- Components re-rendered more than expected
- DevTools didnโt clearly show why
Classic React pain.
๐ The tool I didnโt know I needed
I dropped in React Scan out of curiosity.
No config. No setup. Just a script tag.
And suddenlyโฆ
๐ My app lit up with visual indicators of re-renders.
Instead of guessing, I could now see:
- which components re-render
- how often they re-render
- what triggered them
It immediately exposed issues like:
โ Unstable props
<MyComponent data={{ value: 1 }} />
โ Functions recreated on every render
onClick={() => doSomething()}
โ Missing memoization
const computed = heavyCalculation(data);
4. Fixing state boundaries
Big one.
I had state too high in the tree โ causing cascade re-renders.
๐ Moving state closer to where itโs used reduced updates massively.
๐ The result
After ~30 minutes of cleanup:
- ๐ป Re-renders dropped significantly
- โก UI became noticeably faster
- ๐ง Debugging became predictable instead of guesswork
And the best part?
๐ No premature optimization. Only fixing real problems.
โ ๏ธ One important note
This is a debugging tool, not something you ship to production.
Use it locally or in dev environments only.
๋ฉํ๋ฐ์ดํฐ
- post_id
- ec3f4d665bb4
- slug
- i-accidentally-fixed-my-react-performance-with-one-script-tag-ec3f4d665bb4
- url
- https://medium.com/@mateusz.bieda95/i-accidentally-fixed-my-react-performance-with-one-script-tag-ec3f4d665bb4
- canonical_url
- https://medium.com/@mateusz.bieda95/i-accidentally-fixed-my-react-performance-with-one-script-tag-ec3f4d665bb4
- author_url
- https://medium.com/@mateusz.bieda95
- status
- ok
- fetched_at
- 2026-06-11 17:15:47