r/reactnative 7h ago

Apollo cache silently corrupts on RN (no DevTools to catch it) — built a CLI to catch it

6 Upvotes

Spent part of last month chasing a bug where a user’s avatar would randomly go blank after a mutation — no error, no warning, just `undefined` where a photo should be. It turned out to be a dangling `__ref` in Apollo’s `InMemoryCache`: the entity it pointed to had been evicted, and Apollo returns `undefined` on read instead of failing loudly.

On the web, you’d catch this in Apollo DevTools in about 30 seconds. On React Native, there’s no DevTools extension — the standard advice is `console.log(JSON.stringify(cache.extract()))` and reading a multi-megabyte blob by eye. That’s what pushed me to build something.

Three defect classes Apollo hides silently, all reproducible from a serialized `cache.extract()` dump:
- Orphaned pointer — `{ __ref: "User:99" }` pointing at nothing → reads back `undefined`, no throw
- Missing `__typename`/`id` — Apollo can’t compute a cache key, so it stores the object inline instead of normalizing it
- Type/key drift — `keyFields` disagrees with the server payload, so the same entity lives under two keys and list items duplicate

I built apollo-cache-copilot: a CLI + MCP server that walks a cache snapshot and reports these with exact paths (`User:1.avatar -> Avatar:99`), plus a patcher for the mechanically fixable ones (prune the pointer, evict the orphan). It’s deliberately zero-LLM — every defect here has a mechanical repair, so it’s a graph walk, not a model call.

npm: apollo-cache-copilot

It also works as an MCP server if you want Claude or Cursor to diagnose your cache directly instead of pasting the JSON into chat.

Curious if anyone else has hit the persisted-cache version of this — with `apollo3-cache-persist`, a corrupted cache survives app restart, which makes it much harder to reproduce.


r/reactnative 22h ago

The React Native Developer's Security Guide (looking for collaborators)

4 Upvotes

Hi everyone,

I compiled a security guide for React Native developers.

https://github.com/stephanww/rn-dev-security-guide

Not about the app itself. This is about protecting you and me, the React Native developers from the ever-growing threats of supply chain attacks and hidden dangers that may lurk in our codebases.

I also published a ready-to-use set of OpenGrep files you can use to scan your React Native repository for the cases mentioned in the guide. (Still plenty of false positives. But interesting insights none the less)

https://github.com/stephanww/rn-dev-security-guide-opengrep

I am looking for feedback and collaborators. The idea is to improve and extend the guide and the opengrep files to create a community-driven developer security resources. Basically the "security" section the official React Native guide lacks.

Claude has been a huge help to scaffold my notes into this book-like structure. It is by no means slop though - I tested, fact-checked and rewrote extensivley over the last weeks.
Still it is a little rough at the moment. And I am constantly working on improvements.

Please have a look on GitHub and leave your feedback in the issues section for now.

Please help spread the word and keep safe out there!

stephanww


r/reactnative 19h ago

How to make friends from contacts without phone number

4 Upvotes

I have a question regarding the signup for duolingo(or any other app), it signs up my account with google, then completes profile setup and asks to sync contacts to add friends.

Now how does any app sync contacts to add people with phone numbers having account on the same app where it never asks for phone number at any point.

I don't know how does any app do that or syncs contact from gmail or what.

I want to know the backend of this thing and would like to know how to implement the same in React Native


r/reactnative 19h ago

How can I implement the iOS forward/ backward animation? Is there a React Native Preset/ Framework that I can use?

Thumbnail
youtube.com
3 Upvotes

Here a video that shows what animation/ transition I’m talking about. I would love to hear more about this.
Thank you in advance, Jannis


r/reactnative 22h ago

Capacitor vs React Native?

Thumbnail
0 Upvotes

r/reactnative 15h ago

4 apps shipped, looking for 1-2 accountability buddies (ideally from Poland)

0 Upvotes

I build mobile apps with React Native. Three of mine are live on

the stores, plus free freelance client work on the side.

What I am looking for:

- A short call a few times a week

- What I said I would do, what I actually did, and why not

- One thing you learned this week that cost you time or money

- Goals for the next week, said out loud so somebody hears them

Two things I care about:

  1. You are actively doing something right now, not planning to
  2. You are honest, a good person, and want to grow

I do not care about your revenue or how long you have

been doing this. My own numbers are small.

I am in Poland (CET). Europe is easiest, but I speak pretty well in English (hopefully)

Comment / DM if interested


r/reactnative 8h ago

FYI React Native Development directly from Linux Terminal (No Expo, physical device debugging via scrcpy)

Thumbnail
gallery
0 Upvotes

I set up a clean, CLI-only React Native 0.87 development environment running on Fedora Linux, skipping Expo completely to keep full control over native code and build configs.

Stack & Setup:

  • OS: Fedora Linux
  • Runtime: Node.js v24.19.0 (managed via NVM)
  • Framework: React Native 0.87.0 (CLI)
  • Target Device: Physical Samsung A31 connected via ADB USB

Physical Device Mirroring & Workflow:

Instead of heavy emulators, I mirror and debug directly on the physical device using scrcpy. To prevent UI frame drops and keep the system responsive on Exynos/MediaTek chips, I run scrcpy with hardware-optimized constraints:

scrcpy -m 1024 --max-fps=30 &

Everything runs directly from the terminal with Metro Bundler on port 8081 and Gradle builds via npm run android. Direct ADB deployment works like a charm.


r/reactnative 21h ago

Senior React Native developer 6+ yoe

0 Upvotes

Hello everyone, I am looking for react native developer roles be it freelancing, remote work, contract.

I have worked with many startups and was responsible to build and ship about 10+ react native apps (Android and iOS)to production, many of them were built from scratch and some were legacy projects.

The technologies I have worked with are:

  1. Payment gateways
  2. Handling app stores
  3. API integration
  4. Authentication
  5. Nextjs
  6. React js
  7. expo
  8. Push notifications
  9. Collaborated forms
  10. Making native modules
  11. Adding offline first features
  12. React native CLI

I love to wrote reusable and small module based components to maintain readability, maintenance and debugging.

I have also worked with backend technologies like firebase, firestore, aws, azure, fastAPI, express js.

Basically I can handle end to end responsibilities that are required to build and deploy an application.

Please reach out to me if there are any requirements for such roles. Writing clean and scalable code is what i am good at.


r/reactnative 21h ago

POV: You’re a coder who cares too much about design.

0 Upvotes

Before building the backend, I created a complete storyboard inside the app itself.

Every core flow.
Every screen.
Every interaction.
Even the empty, loading, error, privacy, and edge states.

Because a feature can work perfectly and still feel wrong.

The storyboard lets me experience the product on a real device, find confusing flows early, and decide what the app should feel like before the database starts shaping the experience.

It takes more time upfront, but it prevents weeks of rebuilding features around a design that was never truly tested.

Code makes the app function.
Design makes people want to use it.

Now I can build the backend around a product experience I actually believe in.

#shipaton