Jazz 0.13.0 - React Native Split
Version 0.13.0 introduces a significant architectural change in how Jazz supports React Native applications. We've separated the React Native implementation into two distinct packages to better serve different React Native development approaches:
- jazz-react-native: Focused package for framework-less React Native applications
- jazz-expo: Dedicated package for Expo applications
- jazz-react-native-core: Shared core functionality used by both implementations
This guide focuses on upgrading React Native without Expo applications. If you're using Expo, please see the Expo upgrade guide.
Migration Steps for React Native
- Update Dependencies
# Ensure you have the required dependencies npm install @op-engineering/op-sqlite react-native-mmkv @react-native-community/netinfo # Remove the old packages npm install jazz-react-native-expo # Install the new packages npm install jazz-react-native jazz-react-native-media-images # Run pod install for iOS npx pod-install
- No Import Changes Required
Your existing imports from
jazz-react-native
should continue to work, but the implementation now uses a different storage solution (op-sqlite and MMKV).
Storage Adapter Changes
The jazz-react-native
package now uses:
OpSQLiteAdapter
for database storage (using@op-engineering/op-sqlite
)MMKVStoreAdapter
for key-value storage (usingreact-native-mmkv
) These are now the default storage adapters in theJazzProvider
for framework-less React Native applications.
Example Provider Setup
// App.tsx import {
function JazzProvider(props: JazzProviderProps): React.JSX.Element
JazzProvider } from "jazz-react-native"; import {import MyAppAccount
MyAppAccount } from "./schema"; export functionMyJazzProvider({
function MyJazzProvider({ children }: { children: React.ReactNode; }): React.JSX.Element
children: React.ReactNode
children }: {children: React.ReactNode
children:export namespace React
React.type React.ReactNode = string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | null | undefined
Represents all of the things React can render. Where {@link ReactElement } only represents JSX, `ReactNode` represents everything that can be rendered.ReactNode }) { return ( <function JazzProvider(props: JazzProviderProps): React.JSX.Element
JazzProvidersync: SyncConfig
sync={{peer: "wss://cloud.jazz.tools/?key=you@example.com"
peer: "wss://cloud.jazz.tools/?key=you@example.com" }}AccountSchema?: AccountClass<MyAppAccount> | undefined
AccountSchema={import MyAppAccount
MyAppAccount} > {children: React.ReactNode
children} </function JazzProvider(props: JazzProviderProps): React.JSX.Element
JazzProvider> ); } // Register the Account schema declare module "jazz-react-native" { interface Register {Register.Account: MyAppAccount
Account:import MyAppAccount
MyAppAccount; } }
New Architecture Support
The jazz-react-native
implementation fully supports the React Native New Architecture. This includes compatibility with:
- JavaScript Interface (JSI) for more efficient JavaScript-to-native communication
- Fabric rendering system for improved UI performance
- TurboModules for better native module management
- Codegen for type-safe interfaces
No additional configuration is needed to use Jazz with the New Architecture.
Potential Podfile Issues
If you encounter pod installation issues in a pnpm workspace environment (such as undefined method '[]' for nil
in the Podfile at the line config = use_native_modules!
), replace the problematic line with a manual path reference:
react_native_path = "../node_modules/react-native" config = { :reactNativePath => react_native_path }
This approach bypasses issues with dependency resolution in workspace setups where packages may be hoisted to the root node_modules
.
For More Information
For detailed setup instructions, refer to the React Native Setup Guide