2025-07-10
3293
Peter Aideloje
205750
110
Jul 10, 2025 â‹… 11 min read

React & TypeScript: 10 patterns for writing better code

Peter Aideloje I'm a passionate developer and technical writer whose interest aligns with full-stack software engineering, specifically Java, Csharp, and other frontend stacks like HTML5, CSS3, and JavaScript.

Recent posts:

Gemini CLI vs Codex CLI: A Comparative Analysis

Does Gemini CLI fall short? Here’s how Codex compares

Compare Codex CLI vs Gemini CLI for real-world coding tasks. See strengths, weaknesses, and which AI CLI fits your developer workflow best.

Emmanuel John
Aug 20, 2025 â‹… 8 min read
Is Next.js Still Developer-Friendly?

Is Next.js still developer-friendly?

The question isn’t whether Next.js is good or bad; it’s whether the productivity gains are worth the complexity tax.

Chizaram Ken
Aug 20, 2025 â‹… 5 min read
Don’t Let AI Erase The Next Generation Of Dev Leaders

Don’t let AI erase the next generation of dev leaders

As AI tools take over more routine coding work, some companies are cutting early-career dev roles — a short-sighted move that could quietly erode the next generation of tech leaders if we aren’t careful.

Jack Herrington
Aug 19, 2025 â‹… 6 min read
Nuxt 4.0 Is Here: What’s New And What To Expect

Nuxt 4.0 is here: What’s new and what to expect

Learn what’s new in Nuxt 4, from the app/ directory to TypeScript improvements and data fetching changes. Plus, tips for a smooth migration.

Ikeh Akinyemi
Aug 19, 2025 â‹… 4 min read
View all posts

2 Replies to "React & TypeScript: 10 patterns for writing better code"

  1. I would like to submit a code review for the Record utility snippet! It should read:

    type Role = “admin” | “employee” | “viewer”;

    type Permissions = Record;

    const permissions: Permissions = {
    admin: [“read”, “write”, “delete”],
    employee: [“read”, “write”],
    viewer: [“read”],
    };

    1) The Role type name defined and the name used in the Record utility are inconsistent.

    2) The colons are missing in the key: value pairs of the object literal.

    It’s tough to catch these things without the error highlighting that IDEs provide. Great article!

  2. Thank you for catching that and for taking the time to share your feedback!

    You’re absolutely right on both points:
    1. The Role type named defined in the Record utility should be consistent (Roles or Role) — and in the case of using ‘Role’, the correct syntax would be:

    type Permissions = Record;
    2. Also, the object literal should include colons in the key-value pairs, like so:

    const permissions: Permissions = {
    admin: [“read”, “write”, “delete”],
    employee: [“read”, “write”],
    viewer: [“read”],
    };

    Appreciate you pointing it out, great eye! I’m glad you enjoyed the piece!

Leave a Reply