Need advice about which tool to choose?Ask the StackShare community!
Expo vs NativeBase: What are the differences?
Introduction
Expo and NativeBase are popular tools for building mobile applications using React Native. While Expo provides a comprehensive set of features and services to streamline the development process, NativeBase offers a UI component library to enhance the visual appearance of the application. Let's explore the key differences between Expo and NativeBase in more detail.
Development Environment: Expo provides a complete development environment that includes a command-line interface, development server, and build tools. It simplifies the setup process by providing a single codebase that can be run on both iOS and Android devices without requiring separate configurations. On the other hand, NativeBase is primarily a UI component library that focuses on enhancing the visual aspects of the application. It doesn't provide a development environment out of the box and requires additional configuration for setting up the development environment.
Features and Services: Expo offers a wide range of features and services, such as push notifications, in-app purchases, and over-the-air updates. These built-in capabilities save time and effort in implementing common functionalities. NativeBase, on the other hand, focuses on providing a rich set of UI components, including buttons, inputs, and navigation elements. It enhances the visual appearance of the application by offering ready-to-use components with customizable styles.
Customization: Expo provides a limited scope for customization as it aims to simplify the development process by offering a unified configuration. While it allows for some level of customization through the Expo configuration files, the options are not as extensive as what NativeBase offers. NativeBase allows deep customization of the UI components, including style customization, theming, and extending the functionality of the components. This flexibility enables developers to create unique and tailored user interfaces.
Performance Optimization: Expo aims to optimize performance by abstracting the complexities of the underlying platforms. It provides an optimized runtime environment and reduces the need for device-specific optimizations. NativeBase, on the other hand, focuses on providing visually appealing UI components. While this does not directly impact performance, it does require developers to apply performance optimizations at the component level, such as using memoization techniques and reducing unnecessary re-renders.
Community and Support: Expo has a large and active community of developers, which results in extensive documentation, tutorials, and community-driven packages. The community support provides developers with a wealth of resources to help resolve issues and find solutions quickly. NativeBase, although it does not have as large of a community as Expo, still has an active support system and a dedicated team behind it. It provides documentation, examples, and assistance through forums and GitHub issues.
Deployment: Expo provides a convenient way to deploy mobile applications by offering over-the-air updates and simplified publishing workflows. It allows for easy distribution of applications to a wider audience without requiring access to app stores. NativeBase, being a UI component library, does not directly handle the deployment process. It is up to the developers to integrate the library into their build and deployment pipelines.
In summary, Expo provides a comprehensive development environment with built-in features and services, while NativeBase focuses on enhancing the visual aspects of the application through a rich set of customizable UI components. Expo simplifies the development process by providing a unified configuration, while NativeBase allows for deep customization and performance optimization at the component level.
Hello guys, I am new here. So, if I posted without specific guidelines, please ignore.
Basically, I am an iOS developer and developing native apps for the last three years. Recently, I started learning React Native to develop apps for both platforms. If anyone out there knows any useful resources that will become a better react native developer.
#newbie
Well, the first resource I would recommend you is my upcoming book by Packt Publishing, "Professional React Native", but it's due late January next year :) . Now jokes aside (the book's real by the way :) ), the easiest way to build a iOS/Android/Web app with React Native is to do: npm install -g expo-cli expo init some-project cd some-project expo eject
You might have heard of Expo, but trust me, stay away from it. Expo highest value is that it's an already pre-configured 3 platforms environment, but if you don't eject then you're vendor-locked to what Expo has to offer in iOS and Android, which is very poor compared to going full React Native on these platforms, they can't even handle Google Sign In properly and by the way, even if your app is 10 lines of code your app size will be over 40 MB if you don't eject, yep it's that bad, plus the performance is regular and the loading times slow, not to mention that you're stuck with their build service which the free tier makes you wait for hours for a free build slot. It's important to note that when ejecting you don't lose the Web, you simply do expo start --web to start your dev environment and expo build:web to build a static website that you can serve with any web server. Regarding state management, don't bother with "lifting state up" philosophies mixed with Context API to manage your state, lifting state is a great pattern and helps your codebase, Context is great to avoid prop-drilling, but NEVER mix them to achieve app-wide state management, for that, simply go for Redux or MobX, the hype is all about Redux, but I consider MobX far better in many aspects. However, as you're getting new into this I would recommend you start with Redux AND PLEASE grab yourself npm install @manaflair/redux-batch so that you can batch updates and don't bring your app to a crawl. Forget that "connect HOC" thing with React-Redux, don't bother for a second with it, go with Hooks and useSelector and useDispatch and the likes, it will make your code SO much cleaner and smaller. Adopt clean and new Hooks philosophy, avoid writing class components as much as possible and write function components augmented with Hooks.
Our stack roughly divides into three major components, the front-end, back-end and the data storage.
For the front-end, we have decided to go with React Native via Expo. This allows us to target both Android and iOS with a single codebase. Expo provides "managed workflows" and an SDK that will simplify development and deployment.
For the back-end, we have decided to use Python. Python is the language of choice for machine learning (ML). It has extensive support for traditional ML algorithms (e.g. random forests) via Scikit-Learn and the SciPy ecosystem. On top of this, our industry partner has provided us their current solution written in Python. We decided to expose the back-end as a REST API using FastAPI. This allows us to nicely separate concerns from the rest of the codebase. FastAPIs use of static type hints, validation with Pydantic, and automated documentation allows us to build better APIs faster.
For data storage we decided to use a MongoDB Atlas, a NoSQL database. We decided to use a NoSQL database because we need to store large amounts of data (e.g data from the wearable IMUs). Moreover, due to the ever changing nature of a startup we require flexibility. NoSQL databases are schema-free which enables us to modify our schema as we see fit.
We plan on using GitHub Actions (GA) to orchestrate our CI/CD. Given GAs broad support of languages and workflows, it's hard to go wrong with this decision. We will also be using GitHub for version control and project management, so having everything in one place is convenient.
The major components of our CI/CD for the backend will consist of black for autoformatting, flake8 for linting, pytest for unit-testing, and mypy for static type checking and codecov for coverage reporting. We plan to use separate Docker containers to package the back-end and front-end components and use Docker Compose to launch the app. This allows us to better separate concerns, manage dependencies, and ensure our app is deployable anywhere.
Pros of Expo
- Free15
- Hot Reload13
- Easy to learn9
- Common ios and android app setup9
- Open Source6
- Streamlined6
- Builds into a React Native app5
- PWA supported2
- Plugins for web use with Next.js1
Pros of NativeBase
- Easy setup and use3