DEV Community

Cathy Lai
Cathy Lai

Posted on

AI Writes Code — But It Couldn't Have Invented Expo Router

Most React Native developers have felt this at some point:

React Navigation is powerful, but it often feels… unnatural.

Not because it’s badly designed — it’s not — but because using it requires holding a lot of navigation ceremony in your head at once:

  • Stacks and nested navigators
  • Screen registration
  • Boilerplate wrappers
  • Navigation state that exists separately from your UI

You’re constantly thinking about navigation instead of simply seeing the structure of your app. And that friction is what makes this such a useful example when talking about what AI helps with — and what it doesn’t.

The real problem wasn’t code

If you ask an AI tool today to set up navigation using React Navigation, it will do an excellent job:

  • Generate stack navigators
  • Register screens
  • Wire parameters
  • Add providers and containers

That’s not the issue! The issue is that none of this addresses why navigation feels mentally heavy in the first place. The difficulty wasn’t:

“I don’t know how to write this code.”

It was:

“Why do I need to think about all this just to understand my app’s structure?”

The abstraction shift: configuration → structure

This is why file-based routing felt like such a relief when it arrived in the React Native ecosystem.

With Expo Router, the model changed:

  • Folders became routes
  • Layout files absorbed boilerplate
  • Screens were discovered, not registered
  • Navigation structure became visible at a glance

Instead of declaring your app’s structure, you express it. This didn’t just save lines of code — it removed entire categories of thought.

This is the part AI didn’t do

AI is very good at working inside a system:

  • Filling in boilerplate
  • Applying known patterns
  • Optimizing existing approaches

But this change required something different:

  • Stepping back from the API
  • Noticing developer friction
  • Reframing the problem at the workflow level

AI didn’t wake up one day and decide:

“Navigation shouldn’t be configured — it should be inferred.”

A human did.

In this case, that human was Evan Bacon, who helped bring a higher-level mental model into React Native by asking a deceptively simple question:

“What if navigation just matched how developers already think?”

Why this matters in the age of AI

This example is useful because it’s concrete. AI can:

  • Generate React Navigation code instantly
  • Fix bugs
  • Translate patterns from documentation

But it didn’t:

  • Identify navigation as the wrong abstraction boundary
  • Remove boilerplate by redesigning the mental model
  • Decide that structure should replace configuration

As AI makes implementation cheaper, taste and abstraction become more valuable, not less.

A takeaway for developers

This isn’t about fearing AI or competing with it. It’s about recognizing where human judgment still matters most:

  • Spotting friction that everyone has normalized
  • Asking “why is this hard?” instead of “how do I code this?”
  • Designing systems that remove complexity instead of managing it

File-based routing didn’t win because it was clever.

It won because it felt obvious once you saw it. And that kind of work happens above the code.

If you’re using AI today to generate navigation code, that’s great — you should.

But examples like Expo Router are a reminder that the most valuable engineering work often happens before a single line is written.

Top comments (0)