An easy way to integrate your React (or Preact/React Native Web) app into React Native app with WebView.
The react-native-react-bridge npm package provides a seamless solution for integrating React applications into React Native via WebView. This is especially beneficial for developers looking to avoid the cumbersome process of rewriting existing React code, particularly when prototyping or managing features that are not yet supported by React Native. With its automatic bundling and simplified communication capabilities, this library empowers developers to leverage their web applications within a native environment effectively.
What sets react-native-react-bridge apart is its ability to blend both React and React Native environments, eliminating the usual complexities associated with bridging these two technologies. The resulting functionality allows for an easier and more efficient development experience, making it an attractive choice for those looking to enhance their mobile applications.
Automatic Bundling: Easily create a React (or Preact/React Native Web) app bundle to be used in WebView during the build process of React Native.
Comprehensive JS Module Support: Bundles all JavaScript modules, including those with or without JSX/TypeScript support, ensuring a smooth integration process.
Efficient Communication Hooks: Leverage useWebViewMessage and useNativeMessage hooks for handling messages between React Native and WebView, streamlining interaction.
Asset Management: Supports bundling various asset types using ES6 import syntax, simplifying the management of assets like images, text files, and CSS.
Dynamic Loading: Automatically encodes image formats (e.g., .png, .jpg, etc.) as base64 URLs, allowing for fluid rendering within the application.
Rich File Support: Facilitates importing JSON, .txt, .md, and .html files, with specific handling for rendering in WebView, enhancing functionality and flexibility.
WebAssembly Compatibility: Import WebAssembly modules effectively, making it compatible with modern web standards and enhancing performance.
Custom Transformer Support: Offers guidance on setting up custom transformers in metro.config.js for projects utilizing additional transformers, ensuring compatibility with diverse project structures.