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

Have you ever looked at your HTML or JSX code and thought, “Why is this not working?”
You’re not alone. Even experienced developers make basic mistakes while writing markup. These small errors may look harmless, but they can hurt performance, accessibility, and maintainability.

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 »

Developed my first portfolio.

markdown !Forem Logohttps://media2.dev.to/dynamic/image/width=65,height=,fit=scale-down,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2...