FRONT003infoPro

inline-jsx-handler

Inline arrow functions in JSX cause unnecessary re-renders

Applies to: JavaScript, TypeScript

Why this matters

When you write onClick={() => doSomething()}, a new function is created on every render. This breaks React.memo and PureComponent optimizations because the prop appears to change every time. For components rendered frequently or in lists, this can cause significant performance issues. Use useCallback or define handlers outside JSX.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, FRONT003 includedstablestack explain FRONT003

FRONT003 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: FRONT003