Features

One is a complete solution to cross-platform development with React and React Native. We're experimenting with a features document to offer a high-level overview of One.

See the Status document for the status of features.

Vite

The One Vite Plugin automates away much of the setup & boilerplate required for cross-platform React Native & web development.

Out of the box, the One Vite plugin does the following:

  • Sets up a file system router in the ./app folder
  • Generates types for routes and updates them when routes change
  • Enables loaders and tree shakes them out on client. Using the amazing babel-dead-code-elimination module
  • Enables the deps option that allows for easy node_module patching
  • Swaps between React 18 for native and React 19 for web
  • Adds vite-tsconfig-paths plugin, unless it detects you've added it already
  • Loads .env file into process.env before running anything using dotenv
  • Adds a well-configured tsconfig.json if it doesn't exist
  • Configures native to resolve "react-native" (CJS) and "react-native-import" (ESM) exports field
  • Configures platform-specific extensions web|native|ios|android for extensions ts|tsx|js|mjs, eg .ios.ts
  • Adds a ssr-css plugin that enables perfect dev-mode CSS on first load, matching production
  • Configures a wide variety of optimizeDeps presets for React Native library compatibility
  • Patches a large number of known-bad node_modules to work with Vite
  • Ensures optimized deps across all routes are found before first load, avoiding hard reloads and slow loads in development mode

Universal

Native

  • Implements a custom bundle output with React Native compatible commonjs
  • Implements custom hot reloading that works with commonjs
  • Implements a custom bridge to React Native for debug logging
  • Implements logic to support importing assets, like images

Web

Extras

Edit this page on GitHub.