React Native for Web Developers: 10 Assumptions That Break
The usual advice for a web developer starting React Native is a list of browser habits to unlearn. That list is still right, and it's now mostly a list of mistakes a coding agent won't make for you. I gave Claude Code three React Native tasks worded the way a web developer would ask for them, with hover states, "body text style" and "persist it locally". Across six runs it made none of the classic month-one mistakes.
That changes what a web developer moving to React Native needs to learn first. If the agent writes the screen, the new skill isn't avoiding onClick. It's spotting the subtler problems the agent still ships, which means knowing the ten assumptions well enough to review against them.
What changes when a web developer moves to React Native?
React carries over. Components, hooks, state, effects and data fetching all work the way you expect. The browser doesn't. These are the ten assumptions that break, roughly in the order they bite.
- Styles cascade. They don't. There are no selectors, and the React Native docs (opens in a new tab) describe inheritance as limited to text subtrees: a
Textinside aTextpicks up its parent's style, and nothing else does. You can't set a font on a container and have it flow down. The standard fix is a small typography component. - Text can go anywhere. Every string has to render inside
<Text>. A bare string or number inside aViewthrows, including the easy ones like{count}or{isNew && "New"}. - Flexbox works like CSS. Mostly. The flexbox docs (opens in a new tab) list the exceptions:
flexDirectiondefaults tocolumn,alignContentdefaults toflex-start,flexShrinkdefaults to 0 instead of 1, andflexonly takes one number. There are nopx,remorvhunits. Numbers are density-independent pixels. - The page scrolls. A
Viewdoesn't. If content can overflow, it needs aScrollViewor a list. - Mapping an array is fine. In a
ScrollView,.map()renders every row up front. A list of a few hundred items needsFlatListor FlashList, which virtualize. - Clicks and hover. There's no
onClickand no:hover. You usePressablewithonPressand a pressed style, and touch targets need to be big enough for a thumb: Apple's guidance is at least 44 by 44 points (opens in a new tab), and Google's is 48 by 48 dp (opens in a new tab). - The viewport is a clean rectangle. Phones have notches, home indicators and a keyboard that covers half the screen. Safe areas and keyboard avoidance are your problem on every screen with an input.
- localStorage and cookies. Neither exists.
AsyncStorageis the nearest thing, it's async, and it's unencrypted, so the React Native security guide (opens in a new tab) says not to use it for tokens. Secrets go inexpo-secure-store, which uses the Keychain and Keystore. - Navigating away unmounts the page. In a stack, the previous screen stays mounted under the new one. Effects don't clean up when you push, and work that should pause off-screen belongs in
useFocusEffect. The Expo Router translation guide covers this in more depth. - One codebase behaves the same everywhere. iOS and Android differ on shadows, fonts, keyboard behavior, ripples and back handling.
Platform.selectand.ios.tsxfiles exist because "it works on my simulator" means one platform.
Do AI coding agents make the same React Native mistakes?
I expected yes. Models learn from far more web React than React Native, so it seemed likely an agent would bring the same browser priors a new hire does. To check, I ran Claude Code headless (claude -p, on its default model) against an uninstalled Expo Router skeleton: a package.json, a root _layout.tsx with a Stack, and an index screen. Three tasks, each worded to invite web habits:
- An orders screen: fetch orders (some users have 500+), cards with "a hover state", "clicking a card" opens a detail route, a title and intro "using the app's body text style".
- A settings screen: an email field and Save button that persists the email and an auth token "locally", with a "Saved" message, and it must work on small phones.
- A product card with a soft drop shadow and a two-line title, plus a grid that's 2 across on phones and 4 on tablets.
Each task ran twice: once in a bare project (run A) and once with a ten-line AGENTS.md that restates the ten assumptions above as rules (run B). The agent could only read and write files. I reviewed every file it wrote against the list.
| Run A, no guidance | Run B, checklist in AGENTS.md | |
|---|---|---|
Month-one mistakes (onClick, localStorage, DOM APIs, bare strings, .map() lists) | 0 of 3 tasks | 0 of 3 tasks |
| Long list virtualized | FlatList | FlatList |
| Auth token storage | SecureStore, email in AsyncStorage | SecureStore, email in AsyncStorage |
| Primary buttons under 44 pt (estimated from padding and line height) | 2 of 3 | 0 of 3 |
| Shared body text style | Redefined locally in the screen | Created a Typography component |
| Keyboard handling on settings | KeyboardAvoidingView, no header offset | automaticallyAdjustKeyboardInsets on the ScrollView |
| Card shadow | boxShadow, one style for both platforms | Platform.select with shadow* and elevation |
| Cost for the three tasks | $0.69 | $0.85 (+23%) |
| Output tokens | 12,095 | 16,327 (+35%) |
| Wall time, summed | 128 s | 171 s |
The first row is the result that matters. With no instructions at all, the agent used Pressable and onPress where the prompt said "click", put every string in Text, reached for FlatList because the prompt mentioned 500 orders, put the token in SecureStore with a comment explaining why AsyncStorage was the wrong place, and used useWindowDimensions with the shortest side to tell a tablet from a phone in landscape. Those are the lessons a web developer usually learns from crash screens in the first few weeks.
What the agent still got wrong in React Native
The misses were all second-order, the kind a diff review won't catch unless you know to look:
- Touch targets. The "Try again" button on the orders screen and the "Add to cart" button on the card used 10 points of vertical padding around 14 to 16 point text. That works out to roughly 37 to 39 points tall, under Apple's 44. My numbers come from the style values, not a device measurement, but nothing in either file set a minimum height or
hitSlop. - Keyboard under a header. The settings screen wrapped its form in
KeyboardAvoidingViewwithbehavior="padding"on iOS and nokeyboardVerticalOffset. Under a stack header, that offset is usually what decides whether the focused field ends up visible or half-covered. - No shared text style. Asked for "the app's body text style", the agent noticed there wasn't one, wrote a local
bodystyle in the orders screen and left a comment saying to move it to a shared theme later. That's honest, and it's also how every screen ends up with a slightly different body font size.
None of these would crash. Each one would ship, and each one shows up on a phone, in someone's hand, faster than it shows up in review.
Should you put React Native rules in AGENTS.md?
The checklist fixed what it named. Every button in run B got a 44 or 48 point minimum height or a hitSlop, the orders screen got a shared Typography component, and the settings screen used the ScrollView's own keyboard inset handling instead. That's all three review findings gone, for about a quarter more spend.
It also made one thing worse. Rule ten told the agent iOS and Android differ on shadows, so run B dropped boxShadow and went back to Platform.select with iOS shadow* props and Android elevation. Run A's boxShadow was the more current choice: React Native 0.76 added it as a New Architecture style prop that renders on both platforms (opens in a new tab). A rule written to stop one mistake pulled the agent toward an older pattern it hadn't needed.
So yes, keep a short React Native section in AGENTS.md, but write it as checks on the output ("every Pressable is at least 44 points or has hitSlop") rather than as warnings about the platform ("iOS and Android differ on shadows"). Warnings get interpreted. Checks get satisfied. Better still, turn the checks into something that fails a build, the way a typed style helper can reject off-token colors.
How to learn React Native as a web developer now
If an agent avoids the month-one mistakes on its own, a new React Native developer who only learns to avoid them has learned the part that's already covered. What the agent can't do is hold the phone. The misses in this test were all things you notice by using the screen: a button that's fiddly to hit, a field hidden by the keyboard, two screens with different body text.
For engineering managers onboarding web developers onto a React Native team, that suggests a different first month. Instead of starting them on a ticket written from scratch, have them review agent-written screens on a real device, iOS and Android both, against the ten assumptions above. Ask for a finding per assumption, or a sentence on why it doesn't apply. It teaches the same platform knowledge, and it trains the judgment the job now rests on. The React Native testing post makes the same case for tests: the checks that matter are the ones that run on the app users hold.
Where this stops working
This was a small test. Three tasks, one model, two runs each. The code was never installed, type-checked or run on a simulator, so "no mistakes" means no mistakes I could find by reading it, and the touch target sizes are estimates from style values. A different model, an older one, or a cheaper effort setting could do worse. A messier existing codebase, where the agent copies whatever pattern is nearby, almost certainly would.
The tasks were also screens, which is where React Native looks most like React. The hard parts of a real app sit elsewhere: native modules, build configuration, release channels, performance on a cheap Android phone. An agent that writes a clean settings screen can still write the riskiest line in your Expo app, and the ten assumptions won't help you review that.
And a reviewer who has never been bitten by these mistakes may not believe the warnings. Writing some screens by hand still has value. It just shouldn't be the whole first month anymore.
New posts by email
Sent when they're published. No spam, unsubscribe anytime.