Nozbe rebuilt its long-running web app with React and React Native, aiming to share as much code as possible as a small company. Its mobile app uses patterns such as drawers, keyboard toolbars, and bottom cards, while the web app uses columns, popovers, and hover interactions. Pietruszewski reported 83 percent code reuse across iOS, Android, and web.
Successful Web & React Native Code Sharing Strategies
Speaker
Radek Pietruszewski, technical director at Nozbe, explains his team’s strategies for sharing React and React Native code across iOS, Android, and the web at React Native EU 2019, in a talk hosted by Callstack.
Pietruszewski says existing cross-platform libraries did not meet Nozbe’s needs for flexibility, control, and performance when the team started. They chose a shared repository with separate app, native, web, and root packages, plus platform-specific file extensions such as `.web.js` and `.native.js`. For offline-first persistence, they built Formidable DB to handle many records with lazy loading, reactive updates, synchronization, and support for web and native.
To bridge DOM and React Native styling, Nozbe created Zacs, a Babel plugin that transforms styled component calls into platform-specific code without a runtime. The team used separate native stylesheets and web CSS, while sharing design values such as colors and spacing. They also built a small set of platform-specific base components, including text input, image, icon, and touchable.
For small differences, the team uses platform checks or short helpers, such as handling text input events differently on web and native. When a larger part of a component differs, they put shared logic in a common file and extract platform-specific code into files such as `platform.web.js` and `platform.native.js`. Some components, including modals and lists, have separate implementations to support different layouts or dependencies while keeping shared logic in common.
Pietruszewski identified styling, animation, bundling, complex UI libraries, and end-to-end testing as areas where better shared infrastructure could improve reuse; he said Nozbe’s 83 percent figure excluded about 3,000 lines of styles. He argued for reusing the parts of an app that are the same while investing saved time in learning each platform and polishing its user experience. His target was roughly 90 percent reuse, while preserving meaningful platform differences.
Takeaways
- Measure code reuse with a clear scope; Nozbe’s 83 percent figure excluded roughly 3,000 lines of styles.
- Keep the cross-platform layer thin, and use platform-specific files when differences become substantial.
- Abstract recurring API differences with small helpers instead of scattering conditionals through components.
- Share product logic and common UI while adapting layouts and interactions to platform expectations.
- Use time saved through code reuse to learn and polish each platform.
Mentioned in this talk
Search inside this talk
What was claimed 8
- role atRadek Pietruszewski is CTO at Nozbe
“I'm a technical director at Nozbe”
YouTube Verified2 sources· Talk
- metricNozbe: 83% of code shared between iOS, Android, and the web
“we're at 83 percent”
YouTube Unverified1 source· Talk
- uses
“the web folder is mostly webpack config”
YouTube Unverified1 source· Talk
- builtNozbe built Formidable DB
“we created a framework called Formidable DB”
YouTube Unverified1 source· Talk
- featureFormidable DB: Offline-first, reactive, multiplatform data persistence with synchronization support
“it needs to be multiplatform”
YouTube Unverified1 source· Talk
- launchedbeta
“we're open-sourcing a new solution”
YouTube Unverified1 source· Talk
- featureZacs: Babel plugin with no runtime that transforms shared styling code for React Native and the web
“It has no runtime; it's implemented entirely as a Babel plugin.”
YouTube Unverified1 source· Talk
- uses
“We use webpack and Metro”
YouTube Unverified1 source· Talk





