Need advice about which tool to choose?Ask the StackShare community!

Create React App

1K
1K
+ 1
4
Expo

718
677
+ 1
66
Add tool

Create React App vs Expo: What are the differences?

Introduction

In this article, we will compare the key differences between Create React App and Expo. Both of these tools are widely used in the React Native ecosystem for developing mobile applications. Understanding the differences between them will help developers choose the right tool for their specific needs.

  1. Setup and Configuration: Create React App provides a simple and minimal setup, allowing developers to quickly start building React applications. It generates a basic project structure, sets up the necessary build tools and configurations, making it easy for developers to get started. On the other hand, Expo provides a more opinionated setup that focuses on providing a full development environment for building React Native applications. It includes a command-line interface, a development server, and allows for easy management of assets and dependencies.

  2. Platform Support: Create React App is primarily aimed at building web applications using React. It provides optimized configurations for creating web applications that can run in modern web browsers. Expo, on the other hand, is specifically designed for developing React Native applications that can run on both iOS and Android devices. It abstracts away many platform-specific details and provides a unified development experience for targeting multiple platforms.

  3. Native Module Support: Create React App does not provide direct support for integrating native modules, such as native device features like camera, sensors, or location. It is primarily focused on web development and does not have built-in support for accessing native APIs. Expo, on the other hand, provides a wide range of pre-built native modules, called "Expo SDK", that can be easily integrated into React Native applications. This allows developers to access native functionalities without writing platform-specific code.

  4. Over-the-Air Updates: Expo provides a built-in feature for over-the-air updates, allowing developers to push updates to their app without requiring users to download a new version from the app store. This is particularly useful for making quick bug fixes or adding new features without going through the app store review process. Create React App, being primarily focused on web development, does not provide a similar feature out of the box.

  5. Application Binary Size: Create React App generates optimized web bundles for the application, resulting in relatively smaller-sized app files. These optimized bundles only contain the code and assets required for the specific user's device and browser, resulting in a smaller overall application size. Expo, on the other hand, generates larger-sized app binaries since it includes a runtime and all necessary dependencies for the app to run on different platforms.

  6. Ejecting: Create React App provides an option to "eject" from the pre-configured environment, allowing developers to customize and configure the build system based on their specific needs. This gives developers more flexibility and control over the build process and configurations. Expo, on the other hand, does not have a similar ejecting feature. This means that developers cannot easily customize the underlying build system provided by Expo, limiting their flexibility in certain advanced scenarios.

In summary, Create React App provides a simple setup for building web applications using React, while Expo is designed for developing React Native applications that can run on both iOS and Android devices. Create React App has smaller app file sizes and allows for easy customization through ejecting, while Expo provides in-built support for native modules, over-the-air updates, and a unified development experience for multiple platforms.

Advice on Create React App and Expo
Needs advice
on
ExpoExpoReact NativeReact Native
and
ReduxRedux
in

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

See more
Replies (1)
Javier Silva Ortíz
Senior Full Stack Developer at Aleph Engineering · | 6 upvotes · 308.3K views
Recommends
on
ReduxRedux

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.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Create React App
Pros of Expo
  • 2
    No config, easy to use
  • 2
    Maintained by React core team
  • 15
    Free
  • 13
    Hot Reload
  • 9
    Easy to learn
  • 9
    Common ios and android app setup
  • 6
    Open Source
  • 6
    Streamlined
  • 5
    Builds into a React Native app
  • 2
    PWA supported
  • 1
    Plugins for web use with Next.js

Sign up to add or upvote prosMake informed product decisions

Cons of Create React App
Cons of Expo
  • 1
    No SSR
    Be the first to leave a con

    Sign up to add or upvote consMake informed product decisions

    What is Create React App?

    Create React apps with no build configuration.

    What is Expo?

    It is a framework and a platform for universal React applications. It is a set of tools and services built around React Native and native platforms that help you develop, build, deploy, and quickly iterate on iOS, Android, and web apps.

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use Create React App?
    What companies use Expo?
    Manage your open source components, licenses, and vulnerabilities
    Learn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with Create React App?
    What tools integrate with Expo?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    Blog Posts

    JavaScriptGitHubNode.js+29
    14
    13627
    What are some alternatives to Create React App and Expo?
    Next.js
    Next.js is a minimalistic framework for server-rendered React applications.
    Create React Native App
    Create React Native App allows you to work with all of the Components and APIs in React Native, as well as most of the JavaScript APIs that the Expo App provides.
    Brunch
    Brunch is an assembler for HTML5 applications. It's agnostic to frameworks, libraries, programming, stylesheet & templating languages and backend technology.
    React Native
    React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.
    React.js Boilerplate
    Quick setup for new performance orientated, offline–first React.js applications featuring Redux, hot–reloading, PostCSS, react-router, ServiceWorker, AppCache, FontFaceObserver and Mocha.
    See all alternatives