Material Science andEngineering
Przewodnik dla początkujących do wykorzystania Expo z React Native Development
Table of Contents
Understanding Expo in the React Native Ecosystem
1; 1s; 1s; 1s; 1s; 1g; 1s; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; 1g; g; 1g; g; 1g; g; 1g; g; g; g; 1g; g; g; 1g; g; g; g; g; g; 1g; g; g; g; g; g; g; h; h; h; h; h; 1g; h; h; h; h; h; h; h; h; 1g; h; h; h; h; h; h; h; h; 1g;
The key distintion is between the indi1; indiv1; FLT: 0 + 3; FLT: 0 + 3; managed inside Expo; 1; FLT: 1 + 3; FLT: 1 + 3; AND XI1; FLT: 2 + 3; FLT: 2 + 3; bar + 1; FLT: 3 + 3; FLT: 3 + 3; workflows inside Expo. Beginners almost always start with the managed workflow, where expo handles nativa configuratione. As your app grows, you can contribuild quite; ejet quite; táré nevárkán (now called quilled quild) control.
Why Expo Matters for Beginners (andBeyond)
Before Expo, many developers spent days juss getting a React Native environment to compile. Common pain points included ded version mismatches between Android SDKs, linking nativa libraries manually, and debugging cryptic build errors. Expo eliminates these hurdles:
- Xi1; Xi1; FLT: 0 Xi3; Xcode two start; Usie your phone 's Expo Go app to preview instantly.
- Xi1; Xi1; FLT: 0 XI3; XI3; Unified SDK XI1; XI1; FLT: 1 XI3; XI3;: All Expo libraries are e versioned together. You don 't have te worry about library A being incompatible witch library B.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Over- the- air (OTA) updates Xi1; Xi1; FLT: 1 Xi3; Xi3;: Push JavaScript changes directly to users without out going thrip app story reviews.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Instant sharing Xi1; Xi1; FLT: 1 Xi3; Xi3;: Generate a QR code to share your app in progress with teammates or clients.
- W przypadku gdy państwo członkowskie nie może w pełni wykorzystać swoich uprawnień, Komisja może podjąć decyzję o niestosowaniu tych środków.
For those reasons, Expo is now the recommended starting point by the React Native team itself. Xi1; FLT: 0 X3; Xi3; The official React Native docs Xi1; Xi1; FLT: 1 Xion3; Xion3; guide beginners to use Expo if they ary ary new to mobile development.
Setting Up Your Expo Environment
Warunki wstępne
- Xiv1; Xiv1; FLT: 0 Xiv3; Xiv3; Xiv3; Xiv1; FLT: 1 Xiv3; Xiv3; (wersja 16 or later) - download frem Xiv1; Xiv1; FLT: 2 Xiv3; Xiv3; Xiv3; Xiv3; FLT: 2 Xiv3; Xiv3;.
- A BEL1; BEL1; FLT: 0 BEL3; BEL3; CEDITOR BEL1; BEL1; FLT: 1 BEL3; BEL3; (VS Code is highly recommended).
- A Xi1; Xi1; FLT: 0 Xi3; Xi3; mobile device Xi1; Xi1; FLT: 1 Xi3; Xi3; wigh the Expo Go app installaled (Xi1; Xi1; FLT: 2 Xi3; XI3; iOS Xi1; FLT: 3 XI3; Xi3; OR XI1; XI1; FLT: 4 XI3; XI3; Android Xi1; XI1; FLT: 5 XI3;).
- (Optional) An Instant 1; Amend1; FLT: 0 Propert3; Amend3; Expo confict present1; Amend1; FLT: 1 Propert3; FLT: 1 Propert3; for publishing and sharing - sign up at expo.dev.
Instaling Expo CLI
Expo CLI is thes command- line tool you use te create, run, andbuild apps. Install it globually via npm:
npm install -g expo-cli
If you use Yarn, you can run indi1; Xi1; FLT: 1 + 3; instead. Verify the installation with indi1; Xi1; FLT: 2 + 3; Xi3; FLT: 4; FLT: 4 + 3S shifting towards; Xi1; FLT: 3; FLT: 3 +; Xi3; Xion3; Ae the default starter. While Xion1; XINF: 4 + 3; XITH; Still works, we recommend using thee newer methord:
npx create-expo-app MyFirstApp --template blank
This tworzy minimal project wigh thee latess version of Expo SDK and built- in support for TypeScript if desired.
Exploring thee Project Structure
Once your project is created, open it in your editor. Key files and directories:
- Xi1; Xi1; FLT: 0 Xi3; Xi3; App.js Xi1; Xi1; FLT: 1 Xi3; Xi3; (or App.tsx) - thee entry point of your app. Everything you render starts here.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Package.json Xi1; Xi1; FLT: 1 Xi3; Xi3; - listy zależne (react, react- nativa, expo, and any Expo modules you install).
- Xi1; Xi1; FLT: 0 Xi3; Xi3; app.json Xi1; Xi1; FLT: 1 Xi3; Xi3; - configuation file for your Expo project (app name, icon, splash screen, permissions, etc.).
- Xi1; Xi1; FLT: 0 Xi3; Xi3; node _ modules Xi1; Xi1; FLT: 1 Xi3; Xi3; - contains all installaid packages.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; .expo Xi1; Xi1; FLT: 1 Xi3; Xi3; - local state for Expo, do nott commit to version control.
Te piękne of Expo is that you won 't see android / or ios / folders unless you run present 1; Xi1; FLT: 6 contents 3; Xi3; later. Everything is managed the Expo SDK.
Running Your App for thee First Time
Nawigat to you project directory:
cd MyFirstApp
Rozpocząć ten rozwój server:
npx expo start
A QR code appears in the metral (or a web page opens with the QR code). Xi1; FLT: 0 contain3; FLT: 0 containment; Xi1; FLT: 1 contain3; Xion3; FLT: On iOS, use the default Camera app; on Android, use thee Expo Go app to scan. Thee app will load on your device, and any changes you save in your code ediditiotor will exately reflect (hot reloading). You can also use an Android / OS emulator our cofutu if yovu have set up set up.
Rozwiązywanie problemów Common Emitent
- Reference 1; Xi1; FLT: 0 is 3; Xi3; Connection issues Xi1; Xi1; FLT: 1 is 3; Xi3;: Ensure your phone andd computer ar ne on the same Wi- Fi network. If that failes, use Xi1; FLT: 9 meth3; Xi3; mode by pressing ads 1; Xi1; FLT: 10 methe; Xin the Expo CLI terminal. This works even on different networks.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Expo Go app shows supports supports quented; Unable to find an app quentext; Xi1; FLT: 1 Xi3; Xi3;: Thii usually means the server hasn 't fully started. Wait for the logs to say content; Metro bundler ready. Xionquite; Then scan agaim.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Bundler stuck Xi1; Xi1; FLT: 1 Xi3; Xi3;: Delete the Xi1; Xi1; FLT: 11 Xi3; Xi3; folder and try Xi1; Xi1; FLT: 12 Xi3; Xion3; Xion3; To clear the cache.
Building Your First Screen: A Practical Example
Let 's create a simple screain with a button that shows an alert. Replace the content of indic1; Bett1; FLT: 13 indic3; Bett3; with:
import React from 'react';
import { View, Text, Button, Alert, StyleSheet } from 'react-native';
export default function App() {
const showAlert = () => {
Alert.alert('Hello!', 'You clicked the button.');
};
return (
<View style={styles.container}>
<Text style={styles.title}>Welcome to Expo!</Text>
<Button title="Click Me" onPress={showAlert} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#f0f0f0',
},
title: {
fontSize: 24,
marginBottom: 20,
},
});
Save thee file. You device show thee screen. Pressing thee button triggers thee nativy alert. Notice you didn 't write any Java / Kotlin or Swift code - Expo handled thee bridging.
Adding Navigation wigh Expo Router
Most apps have multiple screens. Xi1; Xi1; FLT: 0 XI3; XI3; Expo Router Xi1; XI1; FLT: 1 XI3; XI3; is the recommended vigation library because it uses s file- based routing (similar to Next.js). It supports deep linking, tabs, stacks, and modals right out of the box.
Install Expo Router
npx expo install expo-router react-native-safe-area-context react-native-screens expo-linking expo-constants
Then adjuss your 1; Xi1; FLT: 16 X3; Xi3; To set thee Xi1; Xi1; FLT: 17 XI3; XI3; entry point to XI1; XI1; FLT: 18 XI3; XI3;. Create an XI1; XI1; FLT: 19 XI3; XI3; directory in your project root. Inside it, create XI1; XI1; XI1; FLT: 20 XI3; XIX3; FET; FOR THE THE HOME SHIEN AND AND; FLT: 1; FLT: 21 XIX3; FOR a secontrid screate:
app/
index.js
about.js
_layout.js (optional, for shared layout)
In Xion1; Xion1; FLT: 23 Xion3; Xion3;:
import { Link } from 'expo-router';
import { View, Text } from 'react-native';
export default function Home() {
return (
<View>
<Text>Home Screen</Text>
<Link href="/about">Go to About</Link>
</View>
);
}
When thee user taps the link, thee app Navigates to eng1; Xi1; FLT: 25 X3; Xi3; without any configuation. Thii Pattern scales to hundreds of screens ands much easyr than traditional React Navigation setups.
Akcesoria Device Features with Expo SDK
Expo provides over 50 modules for device functiality. A few common used one:
CameraCity in New Jersey USA
npx expo install expo-camera
You can request permissions, take photos, and contrid video. Example usage:
import { Camera } from 'expo-camera';
// ... request permission with Camera.requestCameraPermissionsAsync()
Lokation
npx expo install expo-location
Get thee useir 's current position, watch location changes, or geodore adresses.
Powiadomienia
npx expo install expo-notifications
Schedule and handle le local and push notifications. Expo even provides a push notification services so you don 't need a custem backend for sending tokens.
System fileName
npx expo install expo-file-system
Read, write, and manage files on the device. Useful for caching images or downloading content.
Ponieważ te modelki są już gotowe do pracy w firmie Expo 's managed flow, ty możesz zacząć używać tych samych urządzeń jak installing thee npm package.
Debugging andinspecting Your App
Debugging is expetforward in Expo. When you run presenti1; Xi1; FLT: 31 Xi3; Xi3;, the Metro bundler provides a developer menu. On your device, shake it (or use te on- screen debug menu on Android) to accessions options:
- Xiv1; Xiv1; FLT: 0 Xiv3; Xiv3; Reload Xiv1; Xiv1; FLT: 1 Xiv3; Xiv3; - reload the JavaScript bundle.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Open Inspector Xi1; Xi1; FLT: 1 Xi3; Xi3; - opens React DevTools in a browser for Xiont inspector.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Toggle Remote JS Debugging Xi1; Xi1; FLT: 1 Xi3; Xi3; - enables debugging in Chrome DevTools (you can set breakpoints in your JavaScript).
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Show Element Inspector Xi1; Xi1; FLT: 1 Xi3; Xi3; - tap on UI elements to see their props andd styles.
For network requests, you can use tools like signal; 1; Sig1; FLT: 0 Sig3; FLT: 0 Sig3; React Native Debugger signific1; FLT: 1 Sig1; FLT: 1 Sig3; FLT: 3; Or thee built- in network inspector in Chrome DevTools wherene demone debugging is on. Additionally, Expo 's logs appear in thete terminal where you started thee server, showng stack traces and console.log output.
Using Flipper wigh Expo
If you prefer Facebook 's Flipper debugger, you can configure e Expso' s bare workflow to support it, but for managed workflow, thee built- in tools are usually superient. Many developers rely on superi1; Superi1; FLT: 0 superior 3; FLT: 0 superior 3; Expso 's own developer logs superior 1; FLT: 1 superi3; FLT: 3r 90% of debugging tasks.
Managing State in an Expo App
Expo apps are React Native apps, so state management works exactly the same. You can use:
- Xi1; Xi1; FLT: 0 Xi3; Xi3; React Context Xi1; Xi1; FLT: 1 Xi3; Xi3; and Xi1; Xi1; FLT: 2 Xi3; Xi3; useReducer Xi1; Xi1; FLT: 3 XI3; Xi3; for simple to to moderately complex state.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Zustand Xi1; Xi1; FLT: 1 Xi3; Xi3; Or Xi1; Xi1; FLT: 2 Xi3; Xi3; Xi1; FLT: 3 XI3; Xi3; FOR a lightweight, boilerplate- free state library.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Redux Toolkit Xi1; Xi1; FLT: 1 Xi3; Xi3; for large- scale apps with many interconnected state clipes.
Expo doesn 't impose any specific choice. For beginners, starting witt React' s built- in hooks is recommended. You can always migrate to a more experimentate solution later.
Example with React Context:
import { createContext, useContext, useState } from 'react';
const ThemeContext = createContext();
export function ThemeProvider({ children }) {
const [theme, setTheme] = useState('light');
return (
<ThemeContext.Provider value={{ theme, setTheme }}>
{children}
</ThemeContext.Provider>
);
}
export const useTheme = () => useContext(ThemeContext);
Testing Your App
Expo supports Jess of the box. Run supports 1; Ref1; FLT: 33 configuration 3; Ef3; and configure Jess in package.json. You can write unit tests for your contexents andd snapshots. For end- to-end testing, Montex1; FLT: 0 configuration 3; Detox present 1; FLT: 1 contex3; FLT: 1 contex3; Methrecontexs well3; FLT: 3; Eflekscontex1; Empll; EflT: 3- a mobile tool tool workh, considext.
Zbadaj je, jeśli to jest proste.
import React from 'react';
import { render, fireEvent } from '@testing-library/react-native';
import App from '../App';
test('button shows alert', () => {
const { getByText } = render(<App />);
fireEvent.press(getByText('Click Me'));
// Assert that Alert was called (use jest.spyOn)
});
Building andd Publishing Your App
Once your app is ready, you 'll want to o publish it te te App Story and Google Play. Expo simplifies this with cloud build services.
Expo Application Services (EAS)
EAS Build creates production- ready nativy binaries without you having to install Xcode or Android Studio.
- Install Sign 1; Sign 1; FLT: 35 Sign 3; Sign 3; Sign.: Sign.
- Log in: Xi1; Xi1; FLT: 37 Xi3; Xi3;
- Konfiguracja: 1; 1; FLT: 38; 3; With build profiles (development, preview, production).
- Run: Xi1; Xi1; FLT: 39 Xi3; Xi3; or Xi1; Xi1; FLT: 40 Xi3; Xi3;
EAS buduje ciebie app in the cloud and returns an .ipa or .apk file. You can then submit to stores using present 1; Xi1; FLT: 41 presents 3; Xion3;.
Over- the- Air Updates
With 1; Xi1; FLT: 42 X3; Xi3;, you cun push JavaScript updates directly to users witout resubmitting to stores. Configure a channel in app. json and run behind 1; Xi1; FLT: 43 Xion3; (or use EAS Update). The app checs for updates on launch andd dates the latess bundle. This is a game- changer for fixing bugs quicly.
Example app.json update config:
{
"expo": {
"updates": {
"url": "https://u.expo.dev/YOUR_PROJECT_ID",
"enabled": true
}
}
}
Limitations of thee Managed Workflow
/ Kiedy Expo i s powerful, / gdy się dzieje, że jesteś w stanie / tego dokonać, / musisz to zrobić.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Custom nativa modules Xi1; Xi1; FLT: 1 Xi3; Xi3; nie jest dostępny in Expo SDK (np., a new Bluetooth library that hasn 't been wrapped).
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Background tasks Xi1; Xi1; FLT: 1 Xi3; Xi3; that need to run indefinitely (Expo Go andd managed apps have limitations on background execution).
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Push notification customization Xi1; Xi1; FLT: 1 Xi3; Xi3; beyond what Expo offers (np., cremm notification sounds or rich media).
- Xiv1; Xiv1; FLT: 0 Xiv3; Xiv3; Large file sizes Xiv1; Xiv1; FLT: 1 Xiv3; Xiv3; vivys3; vith certain native libraries (managed apps include all of Expo SDK, which adds ~ 20MB).
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Need to run code before app initialization Xi1; Xi1; FLT: 1 Xi3; Xi3; (managed apps have a fixed entry point).
Fortunately, you can quent; eject quent; (actually run inclusive 1; eng.1; FLT: 45 conclusive 3; eng3;) at any time. This generates the ing1; eng1; FLT: 46 continu3; engine 3; and expine 1; eng.1; FLT: 47 contents 3; eng.folders, allowing you tu customize nativa code. Once you do, you can continuse use using expine 's tools butives build OA updates.
Begt Practices for Expo Development
Keep Your Expo SDK Updated
Expo releases a new SDK version every few months. Updating is relatively painless: run prevents 1; Event 1; FLT: 48 presents 3; Event3; and fix any breaking changes. Staying present ensures you have thee latess APIs and security patches.
Usie TypeScript from the Start
Expo first-class supports TypeScript. When you run present 1; Xi1; FLT: 49 presents 3; Xi3;, choose the TypeScript tempplate. It catches many bugs early andd improwises IDE autocomplete.
Optymalne asety obrazowe
Use Instant 1; Belgium; FLT: 50 Preference 3; Belgium; TO Compresses images for your app. Also, leverage Preference 1; Belgium; FLT: 51 Preference 3; Belgium; FLT: 51 Prevenant 3; FLT performant image loading with caching and placeholders.
Leverage thee Expo Community
Te Discord server, forums, and GitHub dyskusjach are extremely activee. Many contexn issues have been solved. Before writingg custem code, search for beigh1; FLT: 0 extre3; expo documentation beigh1; expso documentation beigh1; expe1; FLT: 1 contex3; extrec3; or community recipes.
Plan for App Store Requirements
Even wigh Expo, you must comply with incorporate and Google policies. Ensure your app has privacy manifests, proper icons, and splash screens. Use virtu1; entu1; FLT: 52 virtu3; entu3; tu set permissions and app metadata.
Common Pitfalls andHow to Avoid Them
- Xi1; Xi1; FLT: 0 XI3; XI3; Forgetting to install peer dependencies Xi1; XI1; FLT: 1 XI3; XI3;: When using Expo modules, sometimes you need to manually install related packages (np., XI1; XI1; FLT: 53 XI3; XI3; FOR vigation). The CLI often warns you.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Overusing console.log in production Xi1; Xi1; FLT: 1 Xi3; Xi3;: Removie all console before building. Usie Xi1; Xi1; FLT: 54 Xi3; Xion3; TO Automate this.
- Xi1; Xi1; FLT: 0 Xi3; Xi3; Hardcoding dimensions Xi1; Xi1; FLT: 1 Xi3; Xi3;: Use Xi1; Xi1; FLT: 55 Xi3; Xi3; hook frem React Native te support different shien sizes, including tablets.
- Reliing on Expo Go for final testing present 1; Reli1; FLT: 1 contribution 3; Eligy3; FLT: Expo Go is great for development, but some APIs may behavivne differently on a standalone build. Always tett on a production build (EAS Build) before releasing.
Moving frem Beginner tu Production
Expo is nott just a learning tool; it i s used d by many production apps, including apps for large commersie. The managed workflow can handle apps of moderate completity. If your app needs hevy nativy integrations, the bare workflow is always acceptable. The key is to start simple andd only add nativa code wheren neeneesary.
By mastering Expo, you are learning standard React Native Patterns that transfer tu any native project. The skills you gain - contesent design, state management, navigation, and API integration - are exactly what you need for professional mobile development.
Next Steps andd Resources
- Read the is indic1; Xi1; FLT: 0 Xion3; Xion3; offical Expo tutorial Xion1; Xion1; FLT: 1 Xion3; Xion3; for a step-by- step walktricgh.
- Poznaj te informacje: 1; Xi1; FLT: 0 Xi3; Xi3; Expo Go app Xi1; Xi1; FLT: 1 Xi3; Xi3; tu see what 's acceptable.
- Join the is the 1x1; Xi1; FLT: 0 Xi3; Xi3; Expo Discord Xi1; Xi1; FLT: 1 Xi3; Xi3; for community support.
- Kontrola out 1; Xi1; FLT: 0 Xi3; Xi3; Expo Snack Xi1; Xi1; FLT: 1 Xi3; Xi3; to prototyp directly in your browser.
Building mobile apps with Expo removes the initiatival barriers andlets you focus on what matters: your app 's logic, design, ande user experience. Start today andd experience how fast mobile development can be.