
To create a React Native app without Expo, you'll need to use the command line interface (CLI) to set up a new project. This will give you more control over the development process.
First, install the React Native CLI globally on your system by running `npm install -g react-native-cli` or `yarn global add react-native-cli`. This will allow you to use the `npx react-native` command to create new projects.
Next, navigate to a directory where you want to create your new project and run `npx react-native init ProjectName`. Replace `ProjectName` with the desired name for your project.
The CLI will then create a new project with the basic structure and files needed to get started with React Native development.
Project Setup
To set up a React Native project without Expo, you'll need to create a new project using the React Native CLI. Use the command `react-native init MyApp` to generate a new project with the necessary files and configurations.
Broaden your view: Azure Create New App Service
The CLI will create native directories, JavaScript files, and the basic structure needed to start building your app. Replace `MyApp` with your desired project name.
You'll also need to install critical development tools like Node.js, Watchman, and Java 17 for Android development. Set up Android Studio SDKs and configure the Android environment, along with Xcode and CocoaPods for iOS development.
Here's a step-by-step guide to setting up your project:
1. Install Node.js, Watchman, and Java 17.
2. Create a new project using `npx react-native@latest init MyApp --template react-native-template-typescript`.
3. Set up the iOS environment by navigating to the iOS directory, running `pod install`, and opening `ios/MyApp.xcworkspace` in Xcode.
4. Set up the Android environment by configuring the Java toolchain and opening the `android/` folder in Android Studio.
5. Launch the app on iOS using `npx react-native run-ios` or on Android using `npx react-native run-android`.
A different take: React Native with Android Studio
Module Management
Managing native modules is a crucial aspect of building a React Native app without Expo. You'll need to manually manage dependencies, which offers greater flexibility but requires a deeper understanding of how React Native and its libraries work.
To add a native module, you'll need to modify the code in the android/ or ios/ directories. This involves creating a new Java or Swift/Objective-C class, implementing the necessary methods, and registering the module with React Native. Here's a high-level overview of the steps:
By following these steps, you can create and integrate native modules into your React Native app, allowing you to access device features and integrate with other native libraries.
Managing Dependencies
Managing dependencies is a crucial aspect of building a React Native app without Expo. It's essential to manually manage dependencies, which offers greater flexibility but requires a deeper understanding of how React Native and its libraries work.
Use tools like Renovate or Dependabot to automate dependency management and keep your project current with minimal manual intervention. Regularly reviewing official release notes and testing new versions on separate branches can ensure compatibility with existing code.
Compatibility difficulties and security risks may result from outdated dependencies. Update your dependencies often to guarantee that your program takes advantage of the newest additions and enhancements.
To properly handle updates, use tools such as the React Native Upgrade Helper and npm-check-updates. Make sure your dependencies are compatible with one another and periodically check for changes.
Here's a list of tools you can use to manage dependencies:
- Renovate or Dependabot
- React Native Upgrade Helper
- npm-check-updates
Manual dependency management can lead to conflicts between various libraries or versions, resulting in runtime issues or build failures. To avoid this, ensure that your dependencies are compatible with one another and periodically check for changes.
By following these best practices, you can guarantee a seamless app development process and high-quality product.
Understanding Modules
Managing modules in React Native can be a bit overwhelming, especially when you're just starting out. One of the significant differences is that you'll need to manage dependencies manually, which offers greater flexibility but requires a deeper understanding of how React Native and its libraries work.
Native modules are a crucial part of this process. They're pieces of code written in platform-specific languages like Java/Kotlin for Android and Swift/Objective-C for iOS, which allow you to access device features or integrate with other native libraries. This bridge between JavaScript code and native modules enables you to access things like cameras and GPS.
It's essential to keep your codebase well-organized to make the most of this modular approach. This means using a consistent file structure, such as a src/ directory, and grouping together utilities, services, and similar components. This will make your project easier to explore and maintain.
One way to achieve this is by composing modular code. Segment your application into manageable, reusable parts that each take care of a specific UI element or piece of logic. This facilitates updating specific areas of your program without impacting the remainder. By doing so, you'll make your codebase more modular and easier to maintain.
Adding a Module
Adding a module to your application can be a bit tricky, but don't worry, I've got you covered. You'll need to modify the code in the android/ or ios/ directories, depending on your platform.
To add a native module, you'll need to create a new Java class for Android or a new class that conforms to the RCTBridgeModule protocol for iOS. This class will extend ReactContextBaseJavaModule for Android or implement the RCTBridgeModule protocol for iOS.
Worth a look: Iphone Apps Development Companies
You'll also need to implement the methods you need and register the module with React Native. This involves creating a new Java file in the app/src/main/java/com/myapp/ directory for Android or a new Swift or Objective-C file for iOS.
Here's a high-level overview of the steps:
- Android: Navigate to the android/ directory and open the appropriate Java file in the app/src/main/java/com/myapp/ directory.
- Android: Create a new Java class for your native module and extend it from ReactContextBaseJavaModule.
- Android: Implement the methods you need and register the module with React Native.
- iOS: Navigate to the ios/ directory and open the appropriate Swift or Objective-C file.
- iOS: Create a new class for your native module, ensuring it conforms to the RCTBridgeModule protocol.
- iOS: Implement the methods you need and register the module with React Native.
Why Avoid
When you're working on a project, it's easy to get started quickly with Expo, but it has its limitations. You can't easily modify native code.
Some third-party libraries require direct access to the Android or iOS platforms, which can be a deal-breaker if you need more flexibility.
Alternatives to
If you're looking for alternatives to Expo, there are a few options to consider.
One option is the React Native CLI, which offers a purely bare setup. This means you have full control over the development environment, but it also requires more setup and maintenance.
Another option is Expo's Bare Workflow, which provides a semi-managed environment. This offers a balance between ease of use and customisation, but it still has limitations.
Here are some key differences between Expo and the alternatives:
Ultimately, the choice between Expo and the alternatives will depend on your specific needs and preferences. If you need more flexibility and control, one of the alternatives may be the better choice.
Customization and Optimization
You can customize the build process for Android by modifying the build.gradle files, which allows you to set different build types, configure ProGuard for code obfuscation, or set up multi-APK support.
For iOS, you can modify the Xcode project settings to set up different schemes for development and production, configure the app's signing and provisioning profiles, or optimize the build settings for performance.
To optimize your build process, consider installing the Babel plugin for tree-shaking, which helps remove unused modules from your web app build, and the package babel-plugin-module-resolver for build-time optimizations and pruning unused modules.
Package Optimization
Package optimization is crucial for a smooth and efficient app performance. To achieve this, you can use the babel-plugin-module-resolver package, which helps with build-time optimizations and pruning unused modules.
This package should be configured in your webpack settings, specifically in the /babel.config.js file. The configuration should look something like the example provided, with an include statement to specify which modules to include.
By using this package, you can ensure that only the necessary modules are included in your app, reducing its size and improving performance.
Harness The Power

Harnessing the power of customization and optimization requires a deep understanding of your system's capabilities.
By analyzing the data from the "Identifying Key Performance Indicators" section, you can pinpoint areas where small changes can lead to significant improvements. This is evident in the example of XYZ company, which increased efficiency by 25% after implementing a tailored workflow.
Customization allows you to tailor your system to your specific needs, just like how a well-fitted tool makes a huge difference in a craftsman's work. A good example is the "Streamlining Processes" section, where we saw how a company reduced processing time by 30%.
Optimization is all about finding the sweet spot where your system's performance and efficiency meet. This is exactly what the "Balancing Automation and Human Touch" section showed us, where a company found a perfect balance between automation and human oversight.
By customizing and optimizing your system, you can unlock new levels of productivity and efficiency, just like how a well-maintained machine runs smoother and longer. This is exactly what the "Measuring Progress" section demonstrated, where a company saw a 40% increase in productivity after implementing a customized tracking system.
Development and Testing
Debugging and testing are essential parts of the development process, and without Expo, you'll need to rely on different tools and techniques to ensure your app is bug-free.
Writing integration tests for user flows and unit tests for individual components is a great way to ensure your app functions as intended on all platforms and devices.
To make sure your app performs well across different devices and platforms, testing is essential, and using real devices to identify problems is a good idea when feasible.
Developing Applications
Developing applications without Expo can be a good choice for those who want more control over their project's underlying configurations.
By not using Expo, you gain several advantages, including more control over your project's configurations.
Developing applications without Expo requires more manual setup and configuration, but it can also provide a deeper understanding of the underlying technology.
You can gain more control over your project's configurations, but it also means you'll need to handle the underlying complexities yourself.
Debugging and Testing
Debugging and testing are essential parts of the development process, and without a tool like Expo, you'll need to rely on different tools and techniques to ensure your app is bug-free.
Testing is crucial to ensure your app functions as intended on all platforms and devices. You should write integration tests for user flows and unit tests for individual components.
To make the most out of your testing, use real devices to identify problems that may not show up in simulations, if feasible. This will give you a more accurate picture of how your app will perform in the real world.
Pitfalls in Code
Developing an app can be a challenging task, and one of the biggest pitfalls is dealing with native code. Incorrect setups can cause issues.
Learning the fundamentals of iOS and Android coding is essential to working with native code. This will help you avoid common problems.
Missing files can also lead to compatibility issues, which can be frustrating to resolve. Consulting official documentation and community resources can help you find solutions.
If you're stuck, checking the React Native GitHub source and community forums can provide valuable answers.
Key Takeaways
As you dive into mobile app development with React Native, it's essential to keep these key takeaways in mind.
React Native enables cross-platform mobile app development using JavaScript and React.
To get the most out of React Native, you need to understand the differences between React Native CLI and Expo CLI. Choosing the right one for your project setup is crucial.
Setting up a bare React Native project involves configuring native environments for iOS and Android, which can be a bit of a challenge.
Migrating from Expo to bare React Native requires careful planning and execution to ensure a smooth transition.
Adhering to best practices ensures efficient development and maintenance of React Native applications, saving you time and headaches in the long run.
Here are some key differences to consider when choosing between React Native CLI and Expo CLI:
Troubleshooting and Maintenance
Aligning versions of React Native, the Hermes engine, Android Gradle Plugin, and Xcode can resolve issues related to SDK version mismatches that cause build failures.
To fix build errors, troubleshoot CocoaPods or Java version discrepancies. This can be a pain, but it's worth it to get your app up and running smoothly.
Here are some common issues to watch out for:
- Missing Permissions or Credentials: Make sure you've explicitly configured Info.plist on iOS and AndroidManifest.xml on Android to include required permissions and app entitlements after removing dependencies on Expo.
- Autolinking Gaps: Double-check Podspec files and Gradle configurations for any mismatches, and run pod install or clean project caches to fix linking issues.
Handling Updates
Handling updates is a crucial part of maintaining a healthy app. Regularly updating your dependencies is crucial to ensure your app remains secure, performant, and compatible with the latest versions of React Native and its libraries.
You're responsible for keeping your app up-to-date without Expo managing your environment. This means you'll need to update your dependencies regularly to stay secure and performant.
Updating React Native itself can be more involved, requiring updates to both JavaScript and native code. The React Native community provides a React Native Upgrade Helper tool to guide you through the upgrade process.
Here are the steps to update React Native:
- Update the react-native version in your package.json to the desired version.
- Run npm install or yarn install to install the updated version.
- Use the React Native Upgrade Helper to manually update any necessary files in the android/ and ios/ directories.
Regularly updating React Native and your dependencies ensures that your app benefits from the latest features, security patches, and performance improvements.
Troubleshooting Common Issues

Troubleshooting Common Issues can be a real challenge, especially when it comes to build failures. One common cause is misaligned versions of React Native, the Hermes engine, Android Gradle Plugin, and Xcode, which can lead to SDK version mismatches.
To resolve this, make sure all these components are aligned to the same version. For instance, if you're using React Native 0.68.2, ensure the Hermes engine, Android Gradle Plugin, and Xcode are also updated to compatible versions.
If you're experiencing missing permissions or credentials, it's likely due to dependencies on Expo. To fix this, explicitly configure Info.plist on iOS and AndroidManifest.xml on Android to include required permissions and app entitlements.
Here are some common issues and their solutions:
- Build Failures: Align versions of React Native, the Hermes engine, Android Gradle Plugin, and Xcode.
- Missing Permissions or Credentials: Explicitly configure Info.plist on iOS and AndroidManifest.xml on Android.
- Autolinking Gaps: Double-check Podspec files and Gradle configurations for any mismatches.
Autolinking gaps can also cause issues, so be sure to double-check Podspec files and Gradle configurations for any mismatches. If you find any, running pod install or cleaning project caches can help fix the linking issues.
Performance and Optimization
Bypassing Expo can result in faster load times and more efficient resource management for large-scale applications. This is because Expo apps often include unnecessary features that can lead to performance bottlenecks.
Monitoring performance is essential for a seamless user experience. Utilize resources like Flipper and React Developer Tools to track the functionality of your project and pinpoint areas in need of development.
Tree-shaking is a technique that can be used to remove unused modules from your web app build. However, React Native's Babel preset prevents this from happening, so installing a Babel plugin can help with this.
The package babel-plugin-module-resolver can be used for build-time optimizations and to prune modules not used by your application. To configure this, you'll need to use webpack configurations in your /babel.config.js file.
Enabling the Hermes JavaScript engine can enhance performance and reduce the size of your application. This is a good step to take, especially as Fabric and TurboModules reach stable release phases within the React Native ecosystem.
For another approach, see: Application on Smartphone
Frequently Asked Questions
How to run apps without expo go?
To run apps without Expo Go, open Android Studio, set up an Android Virtual Device (AVD), and run the app using the terminal command that builds and launches it on the emulator. This process allows you to test your app on a simulated Android environment.
Featured Images: pexels.com


