5 Mistakes That 99% Developers Make While Writing HTML or JSX 🚫💻

Published: (February 1, 2026 at 01:03 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Why Clean HTML/JSX Matters

  • Performance – Bad markup can slow page loads.
  • SEO – Search engines favor clean, semantic HTML.
  • Accessibility – Proper tags and attributes make your site usable for everyone.
  • Maintainability – Readable, well‑structured code is easier to debug and extend.

Fixing these issues gives you:

  • ✅ Better SEO (Google loves clean HTML)
  • ✅ Faster rendering in React apps
  • ✅ Easier debugging (future you will thank you)
  • ✅ Improved accessibility for all users
  • ✅ Professional‑quality code for jobs & clients

Mistake #1 – Overusing “ Instead of Semantic Tags

“ isn’t evil, but overusing it makes it hard for browsers and screen readers to understand your layout.

Bad:



Good:



Use , , , , “, etc., to give meaning to your markup.

Mistake #2 – Missing key Props in JSX Lists

React relies on key to track list items. Without it you’ll see unexpected UI bugs.

Bad:

items.map(item => - {item.name}
)

Good:

items.map(item => (
  - {item.name}

))

A simple key prop prevents rendering glitches and improves performance.

Mistake #3 – Skipping Accessibility Basics

Accessibility isn’t optional—it’s a professional responsibility.

  • Images – always provide alt text.
  • Form controls – associate “ with inputs.
  • Buttons – ensure they have clear, descriptive text.

Bad:


Good:

[Image: Company logo]
Name

Submit

Mistake #4 – Embedding Complex Logic Directly in JSX

Heavy conditional logic inside JSX makes components hard to read.

Bad:

{user && user.isAdmin && user.permissions.includes('edit') && (
  Edit
)}

Good:

const canEdit = user?.isAdmin && user?.permissions.includes('edit');

return (
  <>
    {canEdit && Edit}
  
);

Extract logic into variables or helper functions for cleaner JSX.

Mistake #5 – Relying on Inline Styles Everywhere

Inline styles break reusability and consistency.

Bad:

Hello

Good:

  • Use CSS classes
  • Leverage utility‑first frameworks like Tailwind
  • Adopt styled components or CSS modules when appropriate
Hello

Quick Checklist

  • ✅ Use semantic HTML tags
  • ✅ Add key props to list items
  • ✅ Follow basic accessibility (alt, label, button text)
  • ✅ Keep JSX logic simple and declarative
  • ✅ Prefer CSS classes or styled solutions over inline styles

Want more practical developer blogs?

Visit and level up your frontend skills today!

Back to Blog

Related posts

Read more »

How does Tab Order work in the DOM?

Tab order in the DOM follows these rules Default behavior Elements are focused in the order they appear in the HTML source top to bottom, left to right. Only f...

Debug a Coding Journey Blog Page

Workshop Overview Today's post is about the next workshop at freeCodeCamp, specifically in the Accessibility section of the Responsive Web Design certification...