
React Native SQLite: sub-100ms set logging UX
I hit 280–600ms input lag on set logging. Brutal. I fixed it with a tiny write-ahead queue + batched SQLite writes. I stopped rerenders by isolating the input row and memoizing selectors. All on Expo + SQLite. Offline-first. No network required. Context I’m building a fitness app where logging a set must feel instant. Like. Tap. Type. Done. My target was “you can log a set in ~5 seconds”. That only works if the UI reacts in under 100ms. Otherwise you get that sticky keyboard feeling. You know the one. I started with the obvious approach: on every keystroke, write to SQLite. It worked offline. It was correct. And it made the UI lag. Spent 4 hours “optimizing queries”. Most of it was wrong. The real problem wasn’t the SQL. It was the timing. What finally worked: treat the UI as the source of truth for a moment, then persist to SQLite in batches. 1) I stopped writing on every keystroke I was doing this: user types 8 onChangeText fires I UPDATE sets SET reps = 8 ... React re-renders keyboa
Continue reading on Dev.to JavaScript
Opens in a new tab



