<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chandan | Full-Stack Developer on Medium]]></title>
        <description><![CDATA[Stories by Chandan | Full-Stack Developer on Medium]]></description>
        <link>https://medium.com/@chandansingh73718?source=rss-a8d02371a24e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iTcl-Ngs1D-3PqCc-ngZQw.jpeg</url>
            <title>Stories by Chandan | Full-Stack Developer on Medium</title>
            <link>https://medium.com/@chandansingh73718?source=rss-a8d02371a24e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 20:37:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chandansingh73718/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[React Native Notifications & Permissions: A Complete Guide for Android and iOS]]></title>
            <link>https://blog.stackademic.com/react-native-notifications-permissions-a-complete-guide-for-android-and-ios-9e3cf3ac9bbc?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e3cf3ac9bbc</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Tue, 22 Sep 2026 04:41:21 GMT</pubDate>
            <atom:updated>2026-09-24T01:39:42.587Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*9H9JwZ6Vfjo6DM-9wF5zGA.png" /><figcaption>A Complete Guide for Android and iOS</figcaption></figure><p>Notifications look simple from the user’s perspective:</p><blockquote><em>“Your order has been shipped.”</em></blockquote><p>But behind that small notification is a complete system involving <strong>OS permissions, notification channels, device tokens, Firebase Cloud Messaging, background handlers, and platform-specific behavior</strong>.</p><p>If you’re building a React Native application, understanding this architecture is important because Android and iOS don’t handle notifications in exactly the same way.</p><p>In this guide, we’ll build a practical notification system covering:</p><ul><li>Local/native notifications</li><li>Android notification permissions</li><li>iOS notification permissions</li><li>Android notification channels</li><li>Firebase Cloud Messaging</li><li>FCM device tokens</li><li>Foreground notifications</li><li>Background notifications</li><li>Notification click handling</li><li>Permission status checking</li><li>Common mistakes and production best practices</li></ul><h3>What Are Notifications in React Native?</h3><p>There are two major types of notifications you’ll usually work with:</p><h3>1. Local Notifications</h3><p>A local notification is generated directly by the application/device.</p><p>For example:</p><pre>Reminder<br>Your meeting starts in 10 minutes.</pre><p>The application can schedule or display this notification without receiving a message from your backend.</p><p>Libraries such as <strong>Notifee</strong> provide a React Native API for creating and displaying native notifications on Android and iOS.</p><h3>2. Push Notifications</h3><p>Push notifications originate from a server.</p><p>A typical architecture looks like this:</p><pre>Your Backend<br>     │<br>     ▼<br>Firebase Cloud Messaging<br>     │<br>     ▼<br>Android / iOS Device<br>     │<br>     ▼<br>React Native Application</pre><p>Firebase Cloud Messaging supports notification messages and data messages and can target individual devices or groups/topics.</p><h3>Why Permissions Matter</h3><p>One of the most common notification mistakes is assuming that installing an application automatically gives it permission to show notifications.</p><p>That is no longer a safe assumption.</p><p>Android 13 introduced the POST_NOTIFICATIONS runtime permission. Applications targeting Android 13+ need to request permission before they can display notifications.</p><p>iOS also requires the user to authorize notifications.</p><p>Therefore, your application should treat notification permission as a separate part of your application state.</p><p>A simplified flow is:</p><pre>Application starts<br>       │<br>       ▼<br>Check notification permission<br>       │<br>       ├── Granted ───────► Continue<br>       │<br>       └── Not granted<br>                │<br>                ▼<br>        Explain the benefit<br>                │<br>                ▼<br>        Request permission<br>                │<br>          ┌─────┴─────┐<br>          ▼           ▼<br>       Granted      Denied<br>          │           │<br>          ▼           ▼<br>     Notifications   Continue</pre><h3>Project Setup</h3><p>For this tutorial, we’ll use:</p><pre>npm install @notifee/react-native</pre><p>For push notifications:</p><pre>npm install @react-native-firebase/app<br>npm install @react-native-firebase/messaging</pre><p>If you’re using iOS, install CocoaPods dependencies:</p><pre>cd ios<br>pod install<br>cd ..</pre><p>The exact native setup can vary depending on your React Native version and project configuration, so always verify the setup against the current library documentation before deploying.</p><h3>Part 1: Creating a Native Notification</h3><p>Let’s start with the easiest example.</p><p>We want to display:</p><pre>New Message</pre><pre>You have received a new message.</pre><p>Using Notifee:</p><pre>import notifee, {<br>  AndroidImportance,<br>} from &#39;@notifee/react-native&#39;;</pre><pre>export async function displayNotification() {<br>  // Request permission<br>  await notifee.requestPermission();</pre><pre>  // Create Android notification channel<br>  const channelId = await notifee.createChannel({<br>    id: &#39;default&#39;,<br>    name: &#39;Default Notifications&#39;,<br>    importance: AndroidImportance.DEFAULT,<br>  });</pre><pre>  // Display notification<br>  await notifee.displayNotification({<br>    title: &#39;New Message&#39;,<br>    body: &#39;You have received a new message.&#39;,</pre><pre>    android: {<br>      channelId,<br>      pressAction: {<br>        id: &#39;default&#39;,<br>      },<br>    },<br>  });<br>}</pre><p>Notifee’s notification API handles the platform-specific notification APIs while providing a React Native interface. On Android, channels are required for notifications on API 26 and above.</p><p>You can then call:</p><pre>&lt;Button<br>  title=&quot;Show Notification&quot;<br>  onPress={displayNotification}<br>/&gt;</pre><h3>Part 2: Android Notification Permission</h3><p>Android 13 introduced runtime notification permission.</p><p>The permission is:</p><pre>android.permission.POST_NOTIFICATIONS</pre><p>React Native exposes it through:</p><pre>PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS</pre><p>React Native’s PermissionsAndroid API supports checking and requesting Android permissions, including POST_NOTIFICATIONS.</p><p>Example:</p><pre>import {<br>  PermissionsAndroid,<br>  Platform,<br>} from &#39;react-native&#39;;</pre><pre>export async function requestAndroidNotificationPermission() {<br>  if (Platform.OS !== &#39;android&#39;) {<br>    return true;<br>  }</pre><pre>  if (Platform.Version &lt; 33) {<br>    return true;<br>  }</pre><pre>  const result = await PermissionsAndroid.request(<br>    PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,<br>  );</pre><pre>  return result === PermissionsAndroid.RESULTS.GRANTED;<br>}</pre><p>Now you can use:</p><pre>const granted =<br>  await requestAndroidNotificationPermission();</pre><pre>if (granted) {<br>  console.log(&#39;Notifications allowed&#39;);<br>} else {<br>  console.log(&#39;Notifications denied&#39;);<br>}</pre><p>Android provides three important result states:</p><pre>GRANTED<br>DENIED<br>NEVER_ASK_AGAIN</pre><h3>Part 3: A Better Permission Strategy</h3><p>Don’t immediately display the system permission dialog when the application launches.</p><p>Imagine opening an application for the first time and immediately seeing:</p><pre>&quot;Allow MyApp to send notifications?&quot;</pre><p>The user may not understand why.</p><p>A better UX is:</p><pre>Welcome to MyApp</pre><pre>Enable notifications to receive:<br>✓ New messages<br>✓ Order updates<br>✓ Important alerts</pre><pre>[Enable Notifications]</pre><p>Then request the OS permission after the user taps the button.</p><p>This makes the permission request contextual instead of random.</p><h3>Part 4: iOS Notification Permissions</h3><p>iOS handles notification authorization differently.</p><p>The user must authorize notification delivery.</p><p>With Notifee:</p><pre>import notifee, {<br>  AuthorizationStatus,<br>} from &#39;@notifee/react-native&#39;;</pre><pre>export async function requestIOSNotificationPermission() {<br>  const settings = await notifee.requestPermission();</pre><pre>  if (<br>    settings.authorizationStatus ===<br>    AuthorizationStatus.AUTHORIZED<br>  ) {<br>    console.log(&#39;Notifications authorized&#39;);<br>    return true;<br>  }</pre><pre>  if (<br>    settings.authorizationStatus ===<br>    AuthorizationStatus.PROVISIONAL<br>  ) {<br>    console.log(&#39;Notifications provisionally authorized&#39;);<br>    return true;<br>  }</pre><pre>  console.log(&#39;Notifications denied&#39;);</pre><pre>  return false;<br>}</pre><p>iOS permission can include options such as:</p><pre>Alerts<br>Sounds<br>Badges<br>CarPlay<br>Announcements<br>Provisional notifications</pre><h3>Part 5: Creating a Reusable Permission Function</h3><p>Instead of spreading notification permission logic throughout your application, create one service.</p><p>For example:</p><pre>src/<br> ├── services/<br> │    └── notificationService.ts<br> ├── screens/<br> ├── components/<br> └── App.tsx</pre><p>Then:</p><pre>// notificationService.ts</pre><pre>import {<br>  Platform,<br>  PermissionsAndroid,<br>} from &#39;react-native&#39;;</pre><pre>import notifee, {<br>  AuthorizationStatus,<br>} from &#39;@notifee/react-native&#39;;</pre><pre>export async function requestNotificationPermission() {<br>  if (Platform.OS === &#39;android&#39;) {<br>    if (Platform.Version &lt; 33) {<br>      return true;<br>    }</pre><pre>    const result = await PermissionsAndroid.request(<br>      PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,<br>    );</pre><pre>    return result === PermissionsAndroid.RESULTS.GRANTED;<br>  }</pre><pre>  const settings = await notifee.requestPermission();</pre><pre>  return (<br>    settings.authorizationStatus ===<br>      AuthorizationStatus.AUTHORIZED ||<br>    settings.authorizationStatus ===<br>      AuthorizationStatus.PROVISIONAL<br>  );<br>}</pre><p>Now your screen only needs:</p><pre>const enabled = await requestNotificationPermission();</pre><pre>if (enabled) {<br>  console.log(&#39;Ready for notifications&#39;);<br>}</pre><p>This keeps notification logic centralized.</p><h3>Part 6: Android Notification Channels</h3><p>Android 8.0 introduced notification channels.</p><p>A channel lets users control different categories of notifications separately.</p><p>For example:</p><pre>MyApp<br>│<br>├── Messages<br>├── Orders<br>├── Promotions<br>└── Security</pre><p>Each channel can have different behavior.</p><p>For example:</p><pre>const messageChannel = await notifee.createChannel({<br>  id: &#39;messages&#39;,<br>  name: &#39;Messages&#39;,<br>  importance: AndroidImportance.HIGH,<br>});</pre><pre>const orderChannel = await notifee.createChannel({<br>  id: &#39;orders&#39;,<br>  name: &#39;Orders&#39;,<br>  importance: AndroidImportance.DEFAULT,<br>});</pre><p>Then use the appropriate channel:</p><pre>await notifee.displayNotification({<br>  title: &#39;New Message&#39;,<br>  body: &#39;You received a new message.&#39;,</pre><pre>  android: {<br>    channelId: messageChannel,<br>  },<br>});</pre><p>Android channels are not just a developer setting. Users can control channel behavior from system settings.</p><h3>A useful production structure</h3><pre>notifications<br>│<br>├── messages<br>├── orders<br>├── payments<br>├── security<br>└── marketing</pre><p>This gives users more control over what they receive.</p><h3>Part 7: Understanding FCM</h3><p>Now let’s move from local notifications to push notifications.</p><p>Firebase Cloud Messaging acts as the communication layer between your backend and the mobile device.</p><p>The architecture is:</p><pre>┌─────────────────┐<br>             │   Your Backend  │<br>             └────────┬────────┘<br>                      │<br>                      ▼<br>             ┌─────────────────┐<br>             │      FCM        │<br>             └────────┬────────┘<br>                      │<br>              ┌───────┴───────┐<br>              ▼               ▼<br>        ┌──────────┐     ┌──────────┐<br>        │ Android  │     │   iOS    │<br>        └──────────┘     └──────────┘</pre><p>FCM supports both notification and data messages and can target devices or topics.</p><h3>Part 8: Getting the FCM Token</h3><p>Each application installation can have an FCM registration token.</p><p>Your backend needs this token if you want to send a notification to a particular device.</p><p>Example:</p><pre>import messaging from &#39;@react-native-firebase/messaging&#39;;</pre><pre>export async function getFCMToken() {<br>  const token = await messaging().getToken();</pre><pre>  console.log(&#39;FCM Token:&#39;, token);</pre><pre>  return token;<br>}</pre><p>You would normally send this token to your backend:</p><pre>const token = await messaging().getToken();</pre><pre>await fetch(&#39;https://api.example.com/device-token&#39;, {<br>  method: &#39;POST&#39;,</pre><pre>  headers: {<br>    &#39;Content-Type&#39;: &#39;application/json&#39;,<br>  },</pre><pre>  body: JSON.stringify({<br>    token,<br>  }),<br>});</pre><p>Your backend can then associate:</p><pre>User<br>  │<br>  ├── userId<br>  ├── deviceId<br>  └── fcmToken</pre><p>with the user’s account.</p><h3>Part 9: Token Refresh</h3><p>Don’t assume the FCM token will remain unchanged forever.</p><p>Listen for token changes:</p><pre>import messaging from &#39;@react-native-firebase/messaging&#39;;</pre><pre>export function subscribeToTokenRefresh() {<br>  return messaging().onTokenRefresh(async token =&gt; {<br>    console.log(&#39;New FCM token:&#39;, token);</pre><pre>    await sendTokenToBackend(token);<br>  });<br>}</pre><p>A simplified implementation:</p><pre>async function sendTokenToBackend(token: string) {<br>  await fetch(&#39;https://api.example.com/device-token&#39;, {<br>    method: &#39;POST&#39;,</pre><pre>    headers: {<br>      &#39;Content-Type&#39;: &#39;application/json&#39;,<br>    },</pre><pre>    body: JSON.stringify({<br>      token,<br>    }),<br>  });<br>}</pre><p>Firebase recommends handling registration-token changes and sending new tokens to your application server when they change.</p><h3>Part 10: Foreground Notifications</h3><p>One confusing part of push notifications is foreground behavior.</p><p>Suppose your application is open:</p><pre>User<br>  │<br>  ▼<br>React Native App<br>  │<br>  ▼<br>FCM message</pre><p>You can listen for messages while the application is in the foreground:</p><pre>import messaging from &#39;@react-native-firebase/messaging&#39;;</pre><pre>const unsubscribe = messaging().onMessage(<br>  async remoteMessage =&gt; {<br>    console.log(&#39;Foreground message:&#39;, remoteMessage);<br>  },<br>);</pre><p>But receiving a message and displaying a native notification are two different things.</p><p>You can use Notifee to display the notification:</p><pre>import notifee from &#39;@notifee/react-native&#39;;</pre><pre>messaging().onMessage(async remoteMessage =&gt; {<br>  const channelId = await notifee.createChannel({<br>    id: &#39;messages&#39;,<br>    name: &#39;Messages&#39;,<br>  });</pre><pre>  await notifee.displayNotification({<br>    title:<br>      remoteMessage.notification?.title ??<br>      &#39;New Message&#39;,</pre><pre>    body:<br>      remoteMessage.notification?.body ??<br>      &#39;You have a new message.&#39;,</pre><pre>    android: {<br>      channelId,<br>      pressAction: {<br>        id: &#39;default&#39;,<br>      },<br>    },<br>  });<br>});</pre><p>This gives you control over how foreground messages appear.</p><h3>Part 11: Background Notifications</h3><p>When an application is in the background, notification handling can be different.</p><p>For example, Android’s FCM behavior can place notification messages in the system tray rather than invoking your foreground message callback. Messages containing both notification and data payloads also have special background behavior.</p><p>React Native Firebase provides a background message handler:</p><pre>import messaging from &#39;@react-native-firebase/messaging&#39;;</pre><pre>messaging().setBackgroundMessageHandler(<br>  async remoteMessage =&gt; {<br>    console.log(<br>      &#39;Background message:&#39;,<br>      remoteMessage,<br>    );<br>  },<br>);</pre><p>A common mistake is putting this handler inside a React component.</p><p>Don’t do this:</p><pre>function App() {<br>  messaging().setBackgroundMessageHandler(...);</pre><pre>  return &lt;Navigation /&gt;;<br>}</pre><p>Instead, register the background handler at the application entry point.</p><p>For example:</p><pre>// index.js</pre><pre>import messaging from &#39;@react-native-firebase/messaging&#39;;</pre><pre>messaging().setBackgroundMessageHandler(<br>  async remoteMessage =&gt; {<br>    console.log(<br>      &#39;Background message:&#39;,<br>      remoteMessage,<br>    );<br>  },<br>);</pre><p>Then:</p><pre>AppRegistry.registerComponent(<br>  appName,<br>  () =&gt; App,<br>);</pre><h3>Part 12: Handling Notification Clicks</h3><p>Receiving a notification isn’t enough.</p><p>Usually you want to navigate the user somewhere.</p><p>For example:</p><pre>Notification<br>     │<br>     ▼<br>User taps<br>     │<br>     ▼<br>Application opens<br>     │<br>     ▼<br>Order Details</pre><p>Suppose your notification contains:</p><pre>{<br>  &quot;orderId&quot;: &quot;12345&quot;<br>}</pre><p>You can listen for notification-open events:</p><pre>messaging().onNotificationOpenedApp(<br>  remoteMessage =&gt; {<br>    const orderId =<br>      remoteMessage.data?.orderId;</pre><pre>    if (orderId) {<br>      // Navigate to order details<br>      console.log(<br>        &#39;Open order:&#39;,<br>        orderId,<br>      );<br>    }<br>  },<br>);</pre><p>React Native Firebase exposes onNotificationOpenedApp for notifications that open the application from a background state.</p><h3>Part 13: Handling Notifications When the App Was Killed</h3><p>There is another case:</p><pre>App completely closed<br>        │<br>        ▼<br>User receives notification<br>        │<br>        ▼<br>User taps notification<br>        │<br>        ▼<br>App launches</pre><p>You should also check the initial notification:</p><pre>const remoteMessage =<br>  await messaging().getInitialNotification();</pre><pre>if (remoteMessage) {<br>  const orderId =<br>    remoteMessage.data?.orderId;</pre><pre>  console.log(<br>    &#39;App opened from notification:&#39;,<br>    orderId,<br>  );<br>}</pre><p>This is especially important when implementing deep linking.</p><h3>Part 14: Notification Deep Linking</h3><p>A good notification architecture should not only say:</p><pre>New Order</pre><p>It should know where the user needs to go.</p><p>For example:</p><pre>{<br>  &quot;notification&quot;: {<br>    &quot;title&quot;: &quot;New Order&quot;,<br>    &quot;body&quot;: &quot;Order #12345 has been confirmed&quot;<br>  },<br>  &quot;data&quot;: {<br>    &quot;type&quot;: &quot;order&quot;,<br>    &quot;orderId&quot;: &quot;12345&quot;<br>  }<br>}</pre><p>Your application can then route the user:</p><pre>function handleNotification(data: any) {<br>  if (data.type === &#39;order&#39;) {<br>    navigation.navigate(<br>      &#39;OrderDetails&#39;,<br>      {<br>        orderId: data.orderId,<br>      },<br>    );<br>  }<br>}</pre><p>This creates a much better experience.</p><h3>Part 15: Checking Notification Permission</h3><p>Permission can change after your application has been installed.</p><p>For example:</p><pre>Monday:<br>Notifications = ON</pre><pre>Wednesday:<br>User opens Android Settings</pre><pre>Notifications = OFF</pre><p>Your application should be able to detect this.</p><p>With Notifee:</p><pre>import notifee, {<br>  AuthorizationStatus,<br>} from &#39;@notifee/react-native&#39;;</pre><pre>export async function checkNotificationPermission() {<br>  const settings =<br>    await notifee.getNotificationSettings();</pre><pre>  if (<br>    settings.authorizationStatus ===<br>    AuthorizationStatus.AUTHORIZED<br>  ) {<br>    return true;<br>  }</pre><pre>  return false;<br>}</pre><p>Notifee exposes notification settings so applications can determine whether notification permission is currently authorized or denied.</p><h3>Part 16: What If the User Denies Permission?</h3><p>Don’t repeatedly show permission prompts.</p><p>Instead, show a useful message:</p><pre>Notifications are disabled</pre><pre>Enable notifications from Settings<br>to receive important updates.</pre><pre>[Open Settings]</pre><p>Notifee provides APIs for opening notification settings when notifications have been disabled.</p><p>The important UX principle is:</p><pre>Don&#39;t force<br>Don&#39;t spam<br>Explain the value<br>Give the user control</pre><h3>Part 17: Recommended Notification Service</h3><p>For a production project, I prefer keeping notification logic in one place.</p><p>Example:</p><pre>src/<br>│<br>├── services/<br>│   ├── notificationService.ts<br>│   └── firebaseMessaging.ts<br>│<br>├── navigation/<br>│   └── notificationNavigation.ts<br>│<br>├── screens/<br>│<br>└── App.tsx</pre><p>Example service:</p><pre>// notificationService.ts</pre><pre>import notifee, {<br>  AndroidImportance,<br>  AuthorizationStatus,<br>} from &#39;@notifee/react-native&#39;;</pre><pre>export async function initializeNotifications() {<br>  const settings =<br>    await notifee.requestPermission();</pre><pre>  const authorized =<br>    settings.authorizationStatus ===<br>      AuthorizationStatus.AUTHORIZED ||<br>    settings.authorizationStatus ===<br>      AuthorizationStatus.PROVISIONAL;</pre><pre>  if (!authorized) {<br>    return false;<br>  }</pre><pre>  await notifee.createChannel({<br>    id: &#39;default&#39;,<br>    name: &#39;Default Notifications&#39;,<br>    importance: AndroidImportance.DEFAULT,<br>  });</pre><pre>  return true;<br>}</pre><p>Then:</p><pre>useEffect(() =&gt; {<br>  initializeNotifications();<br>}, []);</pre><p>This is much easier to maintain than having notification logic inside multiple screens.</p><h3>Part 18: Backend Architecture</h3><p>For a real application, your backend might store device tokens like this:</p><pre>users<br>│<br>├── id<br>├── name<br>└── email</pre><pre>user_devices<br>│<br>├── id<br>├── user_id<br>├── device_id<br>├── fcm_token<br>├── platform<br>├── created_at<br>└── updated_at</pre><p>Example:</p><pre>{<br>  &quot;userId&quot;: 101,<br>  &quot;deviceId&quot;: &quot;device-abc&quot;,<br>  &quot;fcmToken&quot;: &quot;xxxxx&quot;,<br>  &quot;platform&quot;: &quot;android&quot;<br>}</pre><p>Then your backend can send notifications to the correct devices.</p><p>For example:</p><pre>Order Created<br>      │<br>      ▼<br>Backend<br>      │<br>      ▼<br>Find user&#39;s FCM token<br>      │<br>      ▼<br>Firebase Cloud Messaging<br>      │<br>      ▼<br>User&#39;s phone</pre><p>FCM’s architecture uses a trusted sending environment such as an application server or Cloud Functions together with the client application.</p><h3>Part 19: Notification Payload Design</h3><p>Don’t send only text.</p><p>A good notification payload should contain enough information for your application to understand the event.</p><p>For example:</p><pre>{<br>  &quot;notification&quot;: {<br>    &quot;title&quot;: &quot;Payment Successful&quot;,<br>    &quot;body&quot;: &quot;Your payment of ₹999 was successful.&quot;<br>  },<br>  &quot;data&quot;: {<br>    &quot;type&quot;: &quot;payment&quot;,<br>    &quot;paymentId&quot;: &quot;PAY12345&quot;,<br>    &quot;screen&quot;: &quot;PaymentDetails&quot;<br>  }<br>}</pre><p>Your React Native application can then use:</p><pre>switch (data.type) {<br>  case &#39;payment&#39;:<br>    navigation.navigate(<br>      &#39;PaymentDetails&#39;,<br>      {<br>        paymentId: data.paymentId,<br>      },<br>    );<br>    break;</pre><pre>  case &#39;order&#39;:<br>    navigation.navigate(<br>      &#39;OrderDetails&#39;,<br>      {<br>        orderId: data.orderId,<br>      },<br>    );<br>    break;<br>}</pre><p>This is much more scalable than writing special-case logic for every notification.</p><h3>Part 20: Notification Architecture</h3><p>A production-ready architecture can look like this:</p><pre>┌──────────────────┐<br>                    │    Backend API   │<br>                    └────────┬─────────┘<br>                             │<br>                             ▼<br>                    ┌──────────────────┐<br>                    │ Firebase / FCM   │<br>                    └────────┬─────────┘<br>                             │<br>                ┌────────────┴────────────┐<br>                │                         │<br>                ▼                         ▼<br>        ┌──────────────┐          ┌──────────────┐<br>        │    Android   │          │     iOS      │<br>        └──────┬───────┘          └──────┬───────┘<br>               │                         │<br>               ▼                         ▼<br>        Notification                 APNs / FCM<br>          Channel                        │<br>               │                         │<br>               └────────────┬────────────┘<br>                            ▼<br>                    React Native App<br>                            │<br>                            ▼<br>                    Navigation / UI</pre><p>For iOS, FCM delivers messages through Apple’s APNs infrastructure.</p><h3>Part 21: Common Mistakes</h3><h3>Mistake 1: Requesting Permission Immediately</h3><p>Avoid:</p><pre>useEffect(() =&gt; {<br>  requestNotificationPermission();<br>}, []);</pre><p>on the first screen without context.</p><p>Instead, explain the value first.</p><h3>Mistake 2: Forgetting Android Channels</h3><p>On Android 8.0+, notifications need a channel.</p><p>Use:</p><pre>await notifee.createChannel({<br>  id: &#39;messages&#39;,<br>  name: &#39;Messages&#39;,<br>});</pre><p>Android channels give users control over notification behavior.</p><h3>Mistake 3: Assuming Foreground Notifications Automatically Appear</h3><p>Receiving:</p><pre>messaging().onMessage(...)</pre><p>doesn’t mean you should assume a visible system notification will automatically appear in every scenario.</p><p>For controlled foreground presentation, explicitly display a local notification.</p><h3>Mistake 4: Not Handling Token Changes</h3><p>Don’t save an FCM token once and forget about it.</p><p>Use:</p><pre>messaging().onTokenRefresh(...)</pre><p>and update your backend.</p><h3>Mistake 5: Putting Background Handlers Inside Components</h3><p>Register background handlers outside your React component tree.</p><h3>Mistake 6: Ignoring Permission Changes</h3><p>Users can disable notifications from system settings after initially granting permission.</p><p>Always consider:</p><pre>Granted<br>Denied<br>Changed externally<br>Channel blocked<br>App notifications disabled</pre><h3>Mistake 7: Sending Sensitive Data in Notifications</h3><p>Avoid putting sensitive information directly into notification text.</p><p>Instead of:</p><pre>Your bank account ending in 1234 received ₹50,000.</pre><p>consider:</p><pre>New account activity<br>Tap to view details.</pre><p>Then authenticate the user before displaying sensitive information inside the application.</p><h3>Part 22: Testing Checklist</h3><p>Before releasing your application, test at least these scenarios.</p><h3>Android</h3><pre>☐ Android 12<br>☐ Android 13+<br>☐ Permission granted<br>☐ Permission denied<br>☐ Permission disabled from Settings<br>☐ Channel enabled<br>☐ Channel disabled<br>☐ App foreground<br>☐ App background<br>☐ App killed<br>☐ Notification tapped<br>☐ Multiple notifications</pre><h3>iOS</h3><pre>☐ Permission granted<br>☐ Permission denied<br>☐ Permission changed from Settings<br>☐ App foreground<br>☐ App background<br>☐ App terminated<br>☐ Notification tapped<br>☐ Badge<br>☐ Sound<br>☐ Deep linking</pre><h3>FCM</h3><pre>☐ Token generated<br>☐ Token stored on backend<br>☐ Token refresh handled<br>☐ Foreground message received<br>☐ Background message received<br>☐ Notification click handled<br>☐ Initial notification handled</pre><h3>Part 23: A Simple Production Flow</h3><p>Putting everything together:</p><pre>APP START<br>                       │<br>                       ▼<br>              Check permissions<br>                       │<br>              ┌────────┴────────┐<br>              │                 │<br>           Allowed            Denied<br>              │                 │<br>              ▼                 ▼<br>       Initialize FCM      Show explanation<br>              │                 │<br>              ▼                 ▼<br>       Get FCM token       Request permission<br>              │<br>              ▼<br>       Send token to API<br>              │<br>              ▼<br>          App Running<br>              │<br>       ┌──────┴──────┐<br>       │             │<br>       ▼             ▼<br>   Foreground     Background<br>       │             │<br>       ▼             ▼<br>    onMessage      FCM/APNs<br>       │             │<br>       ▼             ▼<br>    Notifee       System UI<br>       │             │<br>       └──────┬──────┘<br>              ▼<br>        User taps<br>              │<br>              ▼<br>       Read notification data<br>              │<br>              ▼<br>          Navigation</pre><p>This separation makes the system easier to debug and scale.</p><h3>Native Notifications vs Push Notifications</h3><p>One of the easiest ways to understand the whole topic is to remember this:</p><p>FeatureLocal NotificationPush NotificationTriggerDevice/AppBackendInternet requiredUsually noYesFCM requiredNoUsuallyScheduled remindersYesNot necessarilyServer eventsNoYesOrder updatesPossible locallyYesChat messagesLimitedYesReact Native libraryNotifeeFCM + notification library</p><p>The two systems can also work together.</p><p>For example:</p><pre>FCM receives message<br>        ↓<br>React Native processes message<br>        ↓<br>Notifee displays native notification</pre><p>This is a very common architecture when you need consistent control over notification presentation.</p><h3>Screenshots You Should Add to Your Medium Article</h3><p>A technical article becomes much easier to understand when readers can see the result.</p><p>I recommend adding these screenshots.</p><h3>Screenshot 1 — Android Permission Dialog</h3><p>Show:</p><pre>Allow MyApp to send you notifications?</pre><p>Caption:</p><blockquote><em>Android 13+ requires runtime notification permission.</em></blockquote><h3>Screenshot 2 — Android Notification Channel</h3><p>Show:</p><pre>MyApp<br> ├── Messages<br> ├── Orders<br> └── Promotions</pre><p>Caption:</p><blockquote><em>Android notification channels allow users to control different notification categories.</em></blockquote><h3>Screenshot 3 — iOS Permission Dialog</h3><p>Show the iOS notification permission prompt.</p><p>Caption:</p><blockquote><em>iOS requires explicit user authorization before notifications can be displayed.</em></blockquote><h3>Screenshot 4 — Notification in Notification Center</h3><p>Show your actual application notification.</p><p>Caption:</p><blockquote><em>A native notification displayed from React Native.</em></blockquote><h3>Screenshot 5 — Firebase Console</h3><p>Show:</p><pre>Firebase Console<br>      ↓<br>Cloud Messaging<br>      ↓<br>Test Message<br>      ↓<br>FCM Token</pre><p>Caption:</p><blockquote><em>Sending a test push notification through Firebase Cloud Messaging.</em></blockquote><h3>Screenshot 6 — Notification Deep Link</h3><p>Use two screenshots side by side:</p><pre>Notification<br>     ↓<br>Order #12345</pre><p>and:</p><pre>Order Details Screen</pre><p>Caption:</p><blockquote><em>Tapping a notification can route the user directly to relevant application content.</em></blockquote><h3>Diagram You Can Use as the Article Hero Image</h3><p>For the article’s main diagram, use something like:</p><pre>┌─────────────────┐<br>              │   Backend API   │<br>              └────────┬────────┘<br>                       │<br>                       ▼<br>              ┌─────────────────┐<br>              │      FCM        │<br>              └────────┬────────┘<br>                       │<br>              ┌────────┴────────┐<br>              ▼                 ▼<br>        ┌───────────┐     ┌───────────┐<br>        │  Android  │     │    iOS    │<br>        │  Channel  │     │   APNs    │<br>        └─────┬─────┘     └─────┬─────┘<br>              │                 │<br>              └────────┬────────┘<br>                       ▼<br>                React Native<br>                       │<br>                       ▼<br>                 Notifee<br>                       │<br>                       ▼<br>                Native UI</pre><p>A clean dark-background diagram with Android/iOS phone illustrations would work especially well as a Medium cover image.</p><h3>Production Best Practices</h3><p>Before shipping notifications to production, keep these principles in mind:</p><h3>1. Ask for permission at the right moment</h3><p>Don’t ask simply because the app started.</p><p>Ask when the user understands why notifications are useful.</p><h3>2. Keep notification logic centralized</h3><p>Use something like:</p><pre>notificationService.ts</pre><p>instead of duplicating code across screens.</p><h3>3. Separate notification types</h3><p>Use channels/categories such as:</p><pre>messages<br>orders<br>payments<br>security<br>marketing</pre><h3>4. Store tokens securely</h3><p>Associate tokens with authenticated users and devices.</p><h3>5. Handle token refresh</h3><p>Tokens can change.</p><h3>6. Design notification payloads for navigation</h3><p>Include:</p><pre>type<br>id<br>screen</pre><p>when appropriate.</p><h3>7. Don’t expose sensitive information</h3><p>A notification is visible outside your application.</p><h3>8. Test real devices</h3><p>Notification behavior can differ between simulators/emulators and physical devices.</p><h3>Final Thoughts</h3><p>Notifications are much more than:</p><pre>showNotification();</pre><p>A production-ready React Native notification system needs to consider:</p><pre>Permissions<br>     +<br>Notification Channels<br>     +<br>FCM Tokens<br>     +<br>Foreground Handling<br>     +<br>Background Handling<br>     +<br>Notification Clicks<br>     +<br>Deep Linking<br>     +<br>Backend Integration</pre><p>The most important concept is to separate the responsibilities:</p><p><strong>FCM handles message delivery.</strong></p><p><strong>The operating system controls permissions and native notification behavior.</strong></p><p><strong>Notifee can provide React Native control over local/native notification presentation.</strong></p><p><strong>Your backend decides when and to whom a push notification should be sent.</strong></p><p>Once these responsibilities are separated, notification systems become much easier to understand, debug, and scale.</p><p>And that’s the real goal: not simply making a notification appear, but building a notification system that behaves predictably across <strong>Android, iOS, foreground, background, and terminated application states</strong>.</p><h3>Quick Reference</h3><h3>Request Android Permission</h3><pre>await PermissionsAndroid.request(<br>  PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,<br>);</pre><h3>Request iOS Permission</h3><pre>await notifee.requestPermission();</pre><h3>Create Android Channel</h3><pre>await notifee.createChannel({<br>  id: &#39;messages&#39;,<br>  name: &#39;Messages&#39;,<br>});</pre><h3>Display Notification</h3><pre>await notifee.displayNotification({<br>  title: &#39;New Message&#39;,<br>  body: &#39;You have a new message.&#39;,<br>  android: {<br>    channelId: &#39;messages&#39;,<br>  },<br>});</pre><h3>Listen for FCM Messages</h3><pre>messaging().onMessage(async message =&gt; {<br>  console.log(message);<br>});</pre><h3>Listen for Token Changes</h3><pre>messaging().onTokenRefresh(token =&gt; {<br>  console.log(token);<br>});</pre><h3>Handle Notification Opens</h3><pre>messaging().onNotificationOpenedApp(message =&gt; {<br>  console.log(message.data);<br>});</pre><h3>Before you go</h3><ul><li>Please take a moment to like the post and follow the writer!</li><li>Did you know that over 400,000 developers share what they’re building, learning, and discovering across our platforms every month? Learn how you can contribute <a href="https://plainenglish.io/write-for-us"><strong>here</strong></a><strong>.</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e3cf3ac9bbc" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/react-native-notifications-permissions-a-complete-guide-for-android-and-ios-9e3cf3ac9bbc">React Native Notifications &amp; Permissions: A Complete Guide for Android and iOS</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Is Tech Hiring So Low Compared to 2019? The Truth Every Software Developer Needs to Know]]></title>
            <link>https://blog.stackademic.com/why-is-tech-hiring-so-low-compared-to-2019-the-truth-every-software-developer-needs-to-know-629c2325a5c3?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/629c2325a5c3</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Mon, 27 Jul 2026 06:48:02 GMT</pubDate>
            <atom:updated>2026-07-30T09:33:58.732Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>The software industry isn’t dying — it’s changing. Here’s why getting hired is harder today and how you can stay ahead.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*miTg9oG2FSXBvwW9Zor-ng.png" /><figcaption>Why Is Tech Hiring So Low Compared to 2019? The Truth Every Software Developer Needs to Know</figcaption></figure><p>If you’ve been applying for jobs recently and wondering why it’s much harder to get interviews than it was in 2019, you’re not alone.</p><p>Many developers, whether they’re fresh graduates or experienced engineers, feel that the hiring market has slowed significantly. Companies that were aggressively hiring a few years ago are now much more selective.</p><p>So what changed?</p><p>Let’s look at the real reasons behind the decline in hiring and what developers can do to stay competitive.</p><h3>1. The Pandemic Hiring Boom Created an Artificial Demand</h3><p>During 2020 and 2021, businesses rapidly shifted online.</p><p>Companies needed developers for:</p><ul><li>E-commerce platforms</li><li>Video conferencing applications</li><li>Healthcare software</li><li>Remote work tools</li><li>Cloud migration</li><li>Digital banking</li><li>Online education</li></ul><p>Tech giants and startups hired thousands of engineers to meet this sudden demand.</p><p>However, this level of hiring wasn’t sustainable.</p><p>Once digital growth stabilized, companies realized they had hired more employees than necessary.</p><h3>2. Massive Layoffs Increased Competition</h3><p>Beginning in late 2022, many technology companies announced layoffs.</p><p>Thousands of experienced developers entered the job market simultaneously.</p><p>Now imagine two candidates applying for the same position:</p><ul><li>A fresh graduate</li><li>A developer with five years of experience at a well-known company</li></ul><p>Many employers naturally choose the experienced candidate.</p><p>As a result, entry-level hiring became much more competitive.</p><h3>3. Higher Interest Rates Reduced Company Spending</h3><p>In previous years, startups could easily raise investment from venture capital firms.</p><p>After interest rates increased globally:</p><ul><li>Investors became more cautious.</li><li>Funding became harder to secure.</li><li>Startups reduced expenses.</li><li>Hiring plans slowed down.</li></ul><p>Instead of expanding teams, many companies focused on profitability.</p><h3>4. Artificial Intelligence Increased Developer Productivity</h3><p>AI tools such as GitHub Copilot, ChatGPT, Claude, and Cursor allow developers to:</p><ul><li>Generate boilerplate code</li><li>Write unit tests</li><li>Debug faster</li><li>Create documentation</li><li>Refactor code</li></ul><p>This doesn’t eliminate software engineering jobs.</p><p>Instead, it means one developer can accomplish more work than before.</p><p>Companies may need fewer junior developers for routine tasks.</p><h3>5. Companies Are Hiring More Carefully</h3><p>In 2019, many organizations prioritized rapid growth.</p><p>Today, businesses emphasize efficiency.</p><p>Recruiters now look for developers who can contribute immediately.</p><p>Employers value:</p><ul><li>Strong problem-solving skills</li><li>Real-world project experience</li><li>Clean code practices</li><li>System design knowledge</li><li>Database optimization</li><li>Communication skills</li></ul><p>Simply listing programming languages on a résumé is no longer enough.</p><h3>6. Remote Work Changed the Global Talent Pool</h3><p>Remote work opened opportunities worldwide.</p><p>A company in the United States can hire developers from:</p><ul><li>India</li><li>Poland</li><li>Brazil</li><li>Vietnam</li><li>Eastern Europe</li></ul><p>This creates more opportunities globally but also increases competition.</p><p>Developers now compete internationally instead of only within their local city.</p><h3>7. Companies Prefer Multi-Skilled Developers</h3><p>In 2019, organizations often hired specialists for individual roles.</p><p>Today, many employers prefer engineers who understand multiple technologies.</p><p>For example:</p><p>Instead of hiring:</p><ul><li>One frontend developer</li><li>One backend developer</li><li>One DevOps engineer</li></ul><p>A company may hire one full-stack developer who can handle:</p><ul><li>React</li><li>Node.js</li><li>SQL</li><li>Docker</li><li>AWS</li><li>APIs</li><li>CI/CD</li></ul><p>Versatility has become a major advantage.</p><h3>8. The Number of Developers Has Increased</h3><p>Learning software development has become easier than ever.</p><p>Thousands of new developers graduate from:</p><ul><li>Coding bootcamps</li><li>YouTube tutorials</li><li>Online courses</li><li>University programs</li><li>Self-learning platforms</li></ul><p>The supply of developers has increased significantly.</p><p>However, the number of available positions has not grown at the same pace.</p><h3>Is Software Engineering Still a Good Career?</h3><p>Absolutely.</p><p>Technology continues to power nearly every industry.</p><p>Healthcare, finance, manufacturing, telecommunications, logistics, education, and government all depend on software.</p><p>The demand for skilled developers remains strong.</p><p>The difference is that companies now prioritize quality over quantity.</p><p>Developers who continuously improve their skills still receive excellent opportunities.</p><h3>How Developers Can Stay Competitive</h3><p>If you’re looking for software engineering jobs today, focus on building practical skills instead of only collecting certificates.</p><p>Recommended areas include:</p><ul><li>Data Structures and Algorithms</li><li>SQL and Database Optimization</li><li>Backend Development (Node.js, Laravel, Spring Boot, .NET)</li><li>Frontend Frameworks (React, Angular, Vue)</li><li>REST APIs</li><li>Authentication and Security</li><li>Docker</li><li>Cloud Platforms (AWS, Azure, GCP)</li><li>Git and CI/CD</li><li>System Design</li><li>Real-world portfolio projects</li></ul><p>A strong GitHub profile with meaningful projects often makes a better impression than a long list of completed courses.</p><h3>Final Thoughts</h3><p>Hiring today is undoubtedly more challenging than it was in 2019, but that doesn’t mean opportunities have disappeared.</p><p>The market has evolved.</p><p>Companies are hiring fewer people, but they expect each engineer to bring stronger technical skills, practical experience, and the ability to adapt quickly.</p><p>Instead of chasing every new technology, focus on mastering the fundamentals, building production-quality projects, and continuously learning.</p><p>The developers who invest in long-term skills — not short-term trends — will continue to succeed, regardless of how the hiring market changes.</p><p>The goal isn’t just to get hired. It’s to become the kind of developer companies actively want to hire.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=629c2325a5c3" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/why-is-tech-hiring-so-low-compared-to-2019-the-truth-every-software-developer-needs-to-know-629c2325a5c3">Why Is Tech Hiring So Low Compared to 2019? The Truth Every Software Developer Needs to Know</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why SQL Queries Are Faster Than Many Other Data Access Tools]]></title>
            <link>https://blog.stackademic.com/why-sql-queries-are-faster-than-many-other-data-access-tools-f9d3e68b12ab?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9d3e68b12ab</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Fri, 17 Jul 2026 05:59:03 GMT</pubDate>
            <atom:updated>2026-07-22T08:48:14.844Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Understanding what really makes SQL fast — and why it’s still the backbone of modern applications.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TxcACEIQjAGElmQg4WwhtA.png" /></figure><p>Every modern application depends on data. Whether you’re building an ERP, CRM, e-commerce platform, banking software, or analytics dashboard, retrieving data quickly is critical.</p><p>Many developers assume that using an ORM (Object Relational Mapper), NoSQL database, or backend framework automatically provides the best performance. In reality, the speed often comes down to one thing:</p><p><strong>A well-written SQL query.</strong></p><p>SQL has existed for decades, yet it continues to power some of the world’s largest companies because of its efficiency, optimization, and ability to process massive amounts of data.</p><p>Let’s understand why.</p><h3>SQL Doesn’t Read Every Row</h3><p>One of SQL’s biggest strengths is that it doesn’t blindly scan an entire table (when properly indexed).</p><p>Consider this query:</p><pre>SELECT * FROM employees<br>WHERE employee_id = 105;</pre><p>If employee_id is indexed, MySQL can locate the record almost instantly without checking millions of rows.</p><p>Instead of searching one row at a time, SQL uses specialized data structures (such as B-Trees) to jump directly to the required data.</p><p>Imagine looking for a word in a dictionary.</p><p>You don’t start from page one.</p><p>You open near the correct alphabet.</p><p>Indexes work similarly.</p><h3>The SQL Optimizer Is Smarter Than Most Developers</h3><p>When you execute a query, the database doesn’t simply run it exactly as written.</p><p>Instead, it first analyzes the query and creates an execution plan.</p><p>The optimizer decides:</p><ul><li>Which index should be used</li><li>Which table should be read first</li><li>Which JOIN algorithm is fastest</li><li>Whether sorting can be avoided</li><li>Whether filters can be pushed earlier</li><li>How to minimize disk access</li></ul><p>This happens automatically.</p><p>For example:</p><pre>SELECT *<br>FROM orders o<br>JOIN customers c<br>ON o.customer_id = c.id<br>WHERE o.status = &#39;Completed&#39;;</pre><p>The optimizer evaluates multiple strategies and chooses the least expensive one.</p><p>This is one reason SQL databases consistently outperform manually written loops in application code.</p><h3>SQL Processes Data Where It Lives</h3><p>Imagine a table with 5 million records.</p><p>A slow approach is:</p><ol><li>Fetch all records.</li><li>Send them to the application.</li><li>Filter in JavaScript, Python, Java, or PHP.</li><li>Return the result.</li></ol><p>This wastes:</p><ul><li>Network bandwidth</li><li>Server memory</li><li>CPU time</li></ul><p>SQL performs filtering directly inside the database:</p><pre>SELECT *<br>FROM orders<br>WHERE status = &#39;Completed&#39;;</pre><p>Only the required rows travel over the network.</p><p>Less data movement equals better performance.</p><h3>Set-Based Processing Beats Loops</h3><p>Many programming languages process data row by row.</p><p>For example:</p><pre>for(order of orders){<br>   if(order.status==&quot;Completed&quot;){<br>      ...<br>   }<br>}</pre><p>SQL works differently.</p><p>It processes entire sets of rows simultaneously.</p><pre>SELECT *<br>FROM orders<br>WHERE status=&#39;Completed&#39;;</pre><p>Database engines are heavily optimized for set operations.</p><p>This is one of SQL’s biggest performance advantages.</p><h3>Indexes Make Searches Lightning Fast</h3><p>Without an index:</p><pre>1<br>2<br>3<br>4<br>5<br>6<br>...<br>10,000,000</pre><p>The database may inspect every row.</p><p>With an index:</p><pre>Jump<br>↓<br>Locate<br>↓<br>Return</pre><p>The time difference can be enormous.</p><p>For large tables, an indexed lookup may take milliseconds instead of several seconds.</p><h3>SQL Uses Efficient Join Algorithms</h3><p>Developers often write nested loops:</p><pre>Customer 1<br>   Compare all Orders</pre><pre>Customer 2<br>   Compare all Orders</pre><pre>Customer 3<br>   Compare all Orders</pre><p>SQL databases instead use optimized algorithms such as:</p><ul><li>Nested Loop Join</li><li>Hash Join</li><li>Merge Join</li></ul><p>The optimizer automatically selects the best algorithm based on the data.</p><h3>SQL Reduces Network Traffic</h3><p>Suppose your application needs only 20 rows.</p><p>Bad approach:</p><pre>Database<br>↓<br>1,000,000 rows<br>↓<br>Application<br>↓<br>Keep only 20</pre><p>Better approach:</p><pre>SELECT *<br>FROM employees<br>LIMIT 20;</pre><p>Now only 20 rows travel over the network.</p><p>This significantly reduces response time.</p><h3>SQL Uses Statistics</h3><p>Databases maintain statistics about tables.</p><p>They know approximately:</p><ul><li>Number of rows</li><li>Data distribution</li><li>Value frequency</li><li>Index selectivity</li></ul><p>Using these statistics, the optimizer predicts which execution plan will be fastest.</p><p>Most programming languages don’t have this level of knowledge about stored data.</p><h3>SQL Supports Advanced Optimization</h3><p>Modern SQL databases include features such as:</p><ul><li>Query caching (where applicable)</li><li>Covering indexes</li><li>Partitioning</li><li>Parallel execution</li><li>Materialized views (in supported systems)</li><li>Predicate pushdown</li><li>Index-only scans</li></ul><p>These optimizations happen automatically and can dramatically improve performance.</p><h3>SQL vs Application Code</h3><p>Suppose you want total sales by department.</p><p>Application approach:</p><pre>Read every employee</pre><pre>↓</pre><pre>Read every sale</pre><pre>↓</pre><pre>Loop</pre><pre>↓</pre><pre>Calculate totals</pre><p>SQL approach:</p><pre>SELECT department,<br>       SUM(amount)<br>FROM sales<br>GROUP BY department;</pre><p>The database performs the aggregation internally using optimized algorithms.</p><p>This is usually much faster and more memory-efficient.</p><h3>SQL vs ORM</h3><p>ORMs such as Entity Framework, Hibernate, Sequelize, and TypeORM improve developer productivity by generating SQL automatically.</p><p>However, they can introduce inefficiencies:</p><ul><li>N+1 query problems</li><li>Over-fetching unnecessary columns</li><li>Multiple round trips to the database</li><li>Complex generated SQL</li><li>Hidden performance bottlenecks</li></ul><p>For example:</p><pre>User.findAll({<br>    include: [Orders]<br>});</pre><p>The ORM may generate multiple SQL queries or an inefficient join.</p><p>A carefully written SQL query often performs better because it gives the database exactly what it needs.</p><p>The lesson isn’t “don’t use ORMs” — it’s to understand the SQL they generate and optimize when performance matters.</p><h3>SQL Performance Tips</h3><p>Here are a few practical tips:</p><ul><li>Create indexes on frequently searched columns.</li><li>Avoid SELECT *; retrieve only the columns you need.</li><li>Filter data using WHERE as early as possible.</li><li>Use appropriate JOINs.</li><li>Limit result sets with LIMIT or pagination.</li><li>Analyze execution plans using EXPLAIN.</li><li>Avoid unnecessary subqueries.</li><li>Keep indexes maintained and up to date.</li><li>Normalize data where appropriate, and denormalize selectively for performance-critical reporting.</li></ul><h3>When SQL Isn’t the Fastest Choice</h3><p>SQL is powerful, but not every workload is a perfect fit.</p><p>Examples where other technologies may be preferable include:</p><ul><li>Full-text search (search engines like Elasticsearch)</li><li>Real-time caching (Redis)</li><li>Large-scale graph relationships (graph databases)</li><li>Highly connected social network traversals</li><li>Massive event streams requiring specialized storage</li></ul><p>Choosing the right tool depends on the problem you’re solving.</p><h3>Final Thoughts</h3><p>SQL remains one of the fastest and most reliable ways to retrieve and manipulate structured data because it combines decades of research in query optimization, indexing, execution planning, and set-based processing.</p><p>The real performance advantage isn’t just the SQL language — it’s the sophisticated database engine behind it.</p><p>As datasets grow from thousands to millions of records, understanding SQL becomes increasingly valuable. Developers who can write efficient queries often build applications that are not only faster but also more scalable and cost-effective.</p><p>In the end, great performance doesn’t come from using more technology — it comes from using the right technology well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9d3e68b12ab" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/why-sql-queries-are-faster-than-many-other-data-access-tools-f9d3e68b12ab">Why SQL Queries Are Faster Than Many Other Data Access Tools</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Image Upload and File Handling in React Native]]></title>
            <link>https://medium.com/codetodeploy/image-upload-and-file-handling-in-react-native-c276fb14dcb6?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c276fb14dcb6</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[reactnative-app]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Sun, 03 May 2026 06:41:11 GMT</pubDate>
            <atom:updated>2026-05-07T16:41:46.757Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*haeO_GXeZIS_ayQoQJQ3aQ.png" /></figure><p>So far, your app can handle forms, APIs, and local storage. Now it’s time to work with files — especially images, which are a core part of most mobile apps.</p><blockquote><em>🚀 </em><strong><em>Land Your Dream Tech Job in Weeks</em></strong></blockquote><blockquote><strong>💰 $50–$120/hr</strong> | Multiple Roles Open<br> Frontend • Backend • Full Stack • AI/ML • DevOps</blockquote><blockquote><a href="https://optimhire.com/?ref_code=codetodeploy">👉 <strong>Apply Now &amp; Get Hired Faster</strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkQFf0NUnzoFbVEVQCF5WQ.png" /></figure><p>Whether it’s a profile picture, document upload, or product image, handling files correctly is an important skill.</p><h3>Why Image Upload Matters</h3><p>Most real-world apps require users to upload images:</p><ul><li>Profile photos</li><li>Documents (ID, certificates)</li><li>Product images</li><li>Social media posts</li></ul><p>Handling this properly improves both usability and functionality.</p><h3>How File Upload Works</h3><p>The basic flow:</p><ol><li>User selects an image</li><li>App reads the file</li><li>File is sent to a server</li><li>Server stores it (local or cloud)</li></ol><h3>Using Expo Image Picker</h3><p>Expo provides a simple way to pick images from the device.</p><h3>Install:</h3><pre>npx expo install expo-image-picker</pre><h3>Selecting an Image</h3><pre>import * as ImagePicker from &#39;expo-image-picker&#39;;<br>import { Button, Image, View } from &#39;react-native&#39;;<br>import { useState } from &#39;react&#39;;</pre><pre>export default function App() {<br>  const [image, setImage] = useState(null);</pre><pre>  const pickImage = async () =&gt; {<br>    const result = await ImagePicker.launchImageLibraryAsync({<br>      mediaTypes: ImagePicker.MediaTypeOptions.Images,<br>      quality: 1,<br>    });</pre><pre>    if (!result.canceled) {<br>      setImage(result.assets[0].uri);<br>    }<br>  };</pre><pre>  return (<br>    &lt;View&gt;<br>      &lt;Button title=&quot;Pick Image&quot; onPress={pickImage} /&gt;<br>      {image &amp;&amp; &lt;Image source={{ uri: image }} style={{ width: 200, height: 200 }} /&gt;}<br>    &lt;/View&gt;<br>  );<br>}</pre><h3>Taking Photo from Camera</h3><pre>const takePhoto = async () =&gt; {<br>  const result = await ImagePicker.launchCameraAsync();</pre><pre>  if (!result.canceled) {<br>    setImage(result.assets[0].uri);<br>  }<br>};</pre><h3>Uploading Image to Server</h3><p>To upload, use FormData.</p><pre>const uploadImage = async () =&gt; {<br>  const formData = new FormData();</pre><pre>  formData.append(&#39;file&#39;, {<br>    uri: image,<br>    name: &#39;photo.jpg&#39;,<br>    type: &#39;image/jpeg&#39;,<br>  });</pre><pre>  await fetch(&#39;https://your-api.com/upload&#39;, {<br>    method: &#39;POST&#39;,<br>    body: formData,<br>    headers: {<br>      &#39;Content-Type&#39;: &#39;multipart/form-data&#39;,<br>    },<br>  });<br>};</pre><h3>Using Axios for Upload</h3><pre>import axios from &#39;axios&#39;;</pre><pre>await axios.post(&#39;https://your-api.com/upload&#39;, formData, {<br>  headers: {<br>    &#39;Content-Type&#39;: &#39;multipart/form-data&#39;,<br>  },<br>});</pre><h3>Backend Handling (Important)</h3><p>Your backend (Laravel, Node, etc.) should:</p><ul><li>Receive file</li><li>Validate type and size</li><li>Store file</li><li>Return URL</li></ul><h3>Cloud Storage (Recommended)</h3><p>Instead of storing files on your server, use cloud services:</p><ul><li>Cloudinary</li><li>AWS S3</li><li>Firebase Storage</li></ul><p>Benefits:</p><ul><li>Faster delivery (CDN)</li><li>Scalable</li><li>Optimized images</li></ul><h3>Basic Validation</h3><p>Always validate before uploading:</p><pre>if (!image) {<br>  alert(&quot;Please select an image&quot;);<br>}</pre><p>You can also check:</p><ul><li>File size</li><li>File type</li></ul><h3>Showing Upload Progress</h3><p>For better UX, show loading:</p><pre>const [loading, setLoading] = useState(false);</pre><pre>setLoading(true);<br>// upload logic<br>setLoading(false);</pre><h3>Common Mistakes</h3><ul><li>Not using FormData</li><li>Wrong content-type</li><li>Not handling permissions</li><li>Not validating file</li></ul><h3>Permissions (Important)</h3><p>Expo may require permissions:</p><pre>await ImagePicker.requestMediaLibraryPermissionsAsync();</pre><h3>Practice Task</h3><p>Build this:</p><ul><li>Button to pick an image</li><li>Show preview</li><li>Upload button</li><li>Send image to API</li></ul><h3>Conclusion</h3><p>Image upload is a key feature in modern apps. Once you understand how to pick, preview, and upload files, you can build powerful features like profile updates, document systems, and media apps.</p><p>Focus on handling files properly and integrating with your backend.</p><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9QTaaaxboQP_gKSLedW_w.png" /></figure><p>👉 Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></p><p>👉 Follow us: <a href="https://www.linkedin.com/in/bhumika-ch-3784391b9/"><strong>Linkedin</strong></a>| <a href="https://medium.com/codetodeploy"><strong>Medium</strong></a></p><p>👉 CodeToDeploy Tech Community is live on Discord — <a href="https://discord.gg/ZpwhHq6D"><strong>Join now!</strong></a></p><p><strong>Disclosure:</strong> This post includes affiliate and partnership links.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c276fb14dcb6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codetodeploy/image-upload-and-file-handling-in-react-native-c276fb14dcb6">Image Upload and File Handling in React Native</a> was originally published in <a href="https://medium.com/codetodeploy">CodeToDeploy</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AsyncStorage: Storing Data Locally in React Native]]></title>
            <link>https://blog.stackademic.com/asyncstorage-storing-data-locally-in-react-native-d4d5cb3b298d?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4d5cb3b298d</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[reactnative-app]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Fri, 01 May 2026 04:36:58 GMT</pubDate>
            <atom:updated>2026-05-04T07:36:06.684Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_MBoAnMjvAWktQm4Ov9GTQ.png" /><figcaption>AsyncStorage: Storing Data Locally in React Native</figcaption></figure><p>So far, your app can fetch data from APIs and manage state. But what happens when the user closes the app?</p><p>All your data is lost.</p><p>This is where <strong>local storage</strong> becomes important. In React Native, we use <strong>AsyncStorage</strong> to store data on the device so it persists even after the app is closed.</p><h3>Why Local Storage Matters</h3><p>Real-world apps need to remember things like:</p><ul><li>Logged-in user</li><li>App settings</li><li>Theme preference</li><li>Cached data</li></ul><p>Without local storage, users would have to log in every time they open the app.</p><h3>What is AsyncStorage?</h3><p>AsyncStorage is a simple, unencrypted, key-value storage system.</p><p>It works like:</p><ul><li>Save data with a key</li><li>Retrieve it later using the same key</li></ul><h3>Installing AsyncStorage</h3><p>Run this command:</p><pre>npx expo install @react-native-async-storage/async-storage</pre><h3>Saving Data</h3><pre>import AsyncStorage from &#39;@react-native-async-storage/async-storage&#39;;</pre><pre>const saveData = async () =&gt; {<br>  try {<br>    await AsyncStorage.setItem(&#39;username&#39;, &#39;John&#39;);<br>  } catch (e) {<br>    console.log(e);<br>  }<br>};</pre><h3>Getting Data</h3><pre>const getData = async () =&gt; {<br>  try {<br>    const value = await AsyncStorage.getItem(&#39;username&#39;);<br>    if (value !== null) {<br>      console.log(value);<br>    }<br>  } catch (e) {<br>    console.log(e);<br>  }<br>};</pre><h3>Removing Data</h3><pre>await AsyncStorage.removeItem(&#39;username&#39;);</pre><h3>Clearing All Data</h3><pre>await AsyncStorage.clear();</pre><h3>Storing Objects</h3><p>AsyncStorage only stores strings, so objects must be converted.</p><h3>Save Object:</h3><pre>const user = { name: &#39;John&#39;, age: 25 };</pre><pre>await AsyncStorage.setItem(&#39;user&#39;, JSON.stringify(user));</pre><h3>Get Object:</h3><pre>const data = await AsyncStorage.getItem(&#39;user&#39;);<br>const user = JSON.parse(data);</pre><h3>Real Example: Save Login User</h3><pre>const login = async () =&gt; {<br>  const user = { email: &#39;test@test.com&#39; };</pre><pre>  await AsyncStorage.setItem(&#39;user&#39;, JSON.stringify(user));<br>};</pre><p>Load user when app starts:</p><pre>useEffect(() =&gt; {<br>  const loadUser = async () =&gt; {<br>    const data = await AsyncStorage.getItem(&#39;user&#39;);<br>    if (data) {<br>      setUser(JSON.parse(data));<br>    }<br>  };</pre><pre>  loadUser();<br>}, []);</pre><h3>Combining with Context API</h3><p>Best practice:</p><ul><li>Store user in Context (global state)</li><li>Persist user in AsyncStorage</li></ul><p>This way:</p><ul><li>App remembers login</li><li>State stays consistent</li></ul><h3>Best Practices</h3><ul><li>Always use try/catch</li><li>Keep keys meaningful (user, token)</li><li>Avoid storing large data</li><li>Clear data on logout</li></ul><h3>Limitations</h3><ul><li>Not secure for sensitive data</li><li>Not suitable for large datasets</li><li>Async operations (must use await)</li></ul><h3>Common Mistakes</h3><ul><li>Forgetting JSON.stringify / parse</li><li>Not handling errors</li><li>Storing sensitive data (like passwords)</li><li>Blocking UI with heavy storage operations</li></ul><h3>Practice Task</h3><p>Build this:</p><ul><li>Login screen</li><li>Save user in AsyncStorage</li><li>Load user on app start</li><li>Show dashboard if user exists</li></ul><h3>Conclusion</h3><p>AsyncStorage is essential for building real-world apps that need persistence. It helps your app remember users and settings, making the experience smoother and more professional.</p><p>Used correctly, it becomes a key part of your app’s architecture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4d5cb3b298d" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/asyncstorage-storing-data-locally-in-react-native-d4d5cb3b298d">AsyncStorage: Storing Data Locally in React Native</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[State Management: Context API and Global State]]></title>
            <link>https://blog.stackademic.com/state-management-context-api-and-global-state-380bad662f91?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/380bad662f91</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 10:59:02 GMT</pubDate>
            <atom:updated>2026-04-26T12:36:07.589Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2CtDhxNZN7e2-QN5KqvzlQ.png" /></figure><p>So far, you’ve been managing state inside individual components using useState. That works well for small features, but real-world apps need something more structured.</p><p>As your app grows, multiple screens often need access to the same data — like user info, authentication status, or app settings. This is where <strong>global state management</strong> comes in.</p><h3>Why State Management Matters</h3><p>Imagine this situation:</p><ul><li>User logs in on one screen</li><li>You need user data on the dashboard</li><li>You also need it in the profile screen</li></ul><p>Passing data through props across multiple screens becomes messy and hard to maintain.</p><p>State management solves this problem.</p><h3>What is Global State?</h3><p>Global state is data that can be accessed from anywhere in your app.</p><p>Examples:</p><ul><li>Logged-in user</li><li>Theme (dark/light)</li><li>Cart items (in e-commerce)</li><li>App settings</li></ul><h3>Context API (Built-in Solution)</h3><p>React provides Context API to manage global state without extra libraries.</p><p>It’s simple and works well for most apps.</p><h3>Step 1: Create Context</h3><pre>import { createContext } from &#39;react&#39;;</pre><pre>export const AuthContext = createContext();</pre><h3>Step 2: Create Provider</h3><pre>import { useState } from &#39;react&#39;;<br>import { AuthContext } from &#39;./AuthContext&#39;;</pre><pre>export function AuthProvider({ children }) {<br>  const [user, setUser] = useState(null);</pre><pre>  return (<br>    &lt;AuthContext.Provider value={{ user, setUser }}&gt;<br>      {children}<br>    &lt;/AuthContext.Provider&gt;<br>  );<br>}</pre><h3>Step 3: Wrap Your App</h3><pre>import { AuthProvider } from &#39;./AuthProvider&#39;;</pre><pre>export default function App() {<br>  return (<br>    &lt;AuthProvider&gt;<br>      {/* rest of app */}<br>    &lt;/AuthProvider&gt;<br>  );<br>}</pre><h3>Step 4: Use Context Anywhere</h3><pre>import { useContext } from &#39;react&#39;;<br>import { AuthContext } from &#39;./AuthContext&#39;;</pre><pre>export default function Profile() {<br>  const { user } = useContext(AuthContext);</pre><pre>  return &lt;Text&gt;{user?.name}&lt;/Text&gt;;<br>}</pre><pre>Give feedback</pre><h3>Updating Global State</h3><pre>const { setUser } = useContext(AuthContext);</pre><pre>setUser({ name: &#39;John&#39; });</pre><h3>Real Example: Login Flow</h3><ul><li>User logs in</li><li>Save user in global state</li><li>Access user anywhere</li></ul><p>This avoids passing props between screens.</p><h3>When to Use Context API</h3><p>Context API is perfect for:</p><ul><li>Authentication</li><li>Theme settings</li><li>Small to medium apps</li></ul><h3>Limitations of Context API</h3><p>For large applications:</p><ul><li>Performance can be affected</li><li>Too many updates can cause re-renders</li></ul><h3>Other State Management Options</h3><p>For bigger apps, developers use:</p><ul><li>Redux Toolkit</li><li>Zustand</li><li>Recoil</li></ul><p>But for now, Context API is enough.</p><h3>Best Practices</h3><p>To keep things clean:</p><ul><li>Create separate contexts (Auth, Theme, etc.)</li><li>Avoid storing too much data in one context</li><li>Keep logic inside provider</li><li>Use custom hooks for cleaner code</li></ul><h3>Custom Hook Example</h3><pre>import { useContext } from &#39;react&#39;;<br>import { AuthContext } from &#39;./AuthContext&#39;;</pre><pre>export const useAuth = () =&gt; useContext(AuthContext);</pre><p>Usage:</p><pre>const { user } = useAuth();</pre><h3>Common Mistakes</h3><ul><li>Putting everything in one context</li><li>Not wrapping the app properly</li><li>Overusing global state</li><li>Mixing local and global state unnecessarily</li></ul><h3>Practice Task</h3><p>Build this:</p><ul><li>Login screen</li><li>Save user in Context</li><li>Show user name on another screen</li></ul><h3>Conclusion</h3><p>State management is what connects your entire app. Once you understand how to manage global state, your app becomes more organized and easier to scale.</p><p>Start with Context API, and as your app grows, you can explore more advanced tools.</p><h3>A message from our Founder</h3><p>Hey, <a href="https://linkedin.com/in/sunilsandhu">Sunil</a> here. I wanted to take a moment to thank you for reading until the end and for being a part of this community. Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? We don’t receive any funding, we do this to support the community.</p><p>If you want to show some love, please take a moment to follow me on <a href="https://linkedin.com/in/sunilsandhu">LinkedIn</a>, <a href="https://tiktok.com/@messyfounder">TikTok</a>, <a href="https://instagram.com/sunilsandhu">Instagram</a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/">weekly newsletter</a>. And before you go, don’t forget to clap and follow the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=380bad662f91" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/state-management-context-api-and-global-state-380bad662f91">State Management: Context API and Global State</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Integration: Fetching Data and Connecting to Backend]]></title>
            <link>https://blog.stackademic.com/api-integration-fetching-data-and-connecting-to-backend-3cefbec97a23?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cefbec97a23</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Thu, 23 Apr 2026 11:11:42 GMT</pubDate>
            <atom:updated>2026-04-24T07:39:40.637Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2QDfnC4RocP_-O_I52ApUA.png" /></figure><p>Up to this point, your app has been working with static data. But real-world applications depend on dynamic data coming from servers.</p><p>In this part, you’ll learn how to connect your React Native app to an API, fetch data, and display it properly.</p><h3>Why API Integration Matters</h3><p>Almost every modern app depends on APIs.</p><p>APIs allow your app to:</p><ul><li>Fetch user data</li><li>Submit forms</li><li>Load products or posts</li><li>Sync with a backend</li></ul><p>Without API integration, your app remains limited.</p><h3>Understanding the Basics</h3><p>When your app needs data:</p><ol><li>It sends a request to a server</li><li>The server responds with data (usually JSON)</li><li>Your app displays that data</li></ol><h3>Using Fetch (Built-in Method)</h3><p>React Native provides a built-in fetch function.</p><h3>Example:</h3><pre>import { useEffect, useState } from &#39;react&#39;;<br>import { View, Text } from &#39;react-native&#39;;</pre><pre>export default function App() {<br>  const [data, setData] = useState([]);</pre><pre>  useEffect(() =&gt; {<br>    fetch(&#39;https://jsonplaceholder.typicode.com/posts&#39;)<br>      .then(res =&gt; res.json())<br>      .then(json =&gt; setData(json));<br>  }, []);</pre><pre>  return (<br>    &lt;View&gt;<br>      {data.slice(0, 5).map((item) =&gt; (<br>        &lt;Text key={item.id}&gt;{item.title}&lt;/Text&gt;<br>      ))}<br>    &lt;/View&gt;<br>  );<br>}</pre><pre>Give feedback</pre><h3>Using Axios (Preferred)</h3><p>Axios is a popular library that simplifies API calls.</p><h3>Install Axios:</h3><pre>npm install axios</pre><h3>Example with Axios:</h3><pre>import axios from &#39;axios&#39;;<br>import { useEffect, useState } from &#39;react&#39;;<br>import { View, Text } from &#39;react-native&#39;;</pre><pre>export default function App() {<br>  const [data, setData] = useState([]);</pre><pre>  useEffect(() =&gt; {<br>    axios.get(&#39;https://jsonplaceholder.typicode.com/posts&#39;)<br>      .then(res =&gt; setData(res.data))<br>      .catch(err =&gt; console.log(err));<br>  }, []);</pre><pre>  return (<br>    &lt;View&gt;<br>      {data.slice(0, 5).map((item) =&gt; (<br>        &lt;Text key={item.id}&gt;{item.title}&lt;/Text&gt;<br>      ))}<br>    &lt;/View&gt;<br>  );<br>}</pre><pre>Give feedback</pre><h3>Handling Loading State</h3><p>Always show something while data is loading.</p><pre>const [loading, setLoading] = useState(true);</pre><pre>useEffect(() =&gt; {<br>  fetch(url)<br>    .then(res =&gt; res.json())<br>    .then(data =&gt; {<br>      setData(data);<br>      setLoading(false);<br>    });<br>}, []);</pre><pre>{loading ? &lt;Text&gt;Loading...&lt;/Text&gt; : &lt;Text&gt;Data Loaded&lt;/Text&gt;}</pre><h3>Handling Errors</h3><p>Never ignore errors.</p><pre>.catch(error =&gt; {<br>  console.log(error);<br>});</pre><p>Better approach:</p><pre>const [error, setError] = useState(&#39;&#39;);</pre><pre>.catch(err =&gt; {<br>  setError(&quot;Something went wrong&quot;);<br>});</pre><h3>POST Request (Sending Data)</h3><p>Example:</p><pre>axios.post(&#39;https://example.com/api&#39;, {<br>  name: &#39;John&#39;,<br>  email: &#39;john@test.com&#39;<br>})</pre><h3>Displaying API Data with FlatList</h3><pre>import { FlatList, Text } from &#39;react-native&#39;;</pre><pre>&lt;FlatList<br>  data={data}<br>  keyExtractor={(item) =&gt; item.id.toString()}<br>  renderItem={({ item }) =&gt; &lt;Text&gt;{item.title}&lt;/Text&gt;}<br>/&gt;</pre><h3>Best Practices</h3><p>To build clean API integration:</p><ul><li>Keep API logic separate (create a service file)</li><li>Handle loading and error states</li><li>Avoid calling API multiple times unnecessarily</li><li>Use environment variables for API URLs</li></ul><h3>Common Mistakes</h3><p>Some common issues:</p><ul><li>Not handling loading state</li><li>Ignoring errors</li><li>Hardcoding API URLs</li><li>Calling API inside render</li></ul><h3>Practice Task</h3><p>Build a simple screen:</p><ul><li>Fetch data from an API</li><li>Show loading text</li><li>Display data in a list</li><li>Handle error state</li></ul><h3>Conclusion</h3><p>API integration is what makes your app dynamic and useful. Once you understand how to fetch and display data properly, you can build real-world applications like dashboards, social apps, and e-commerce platforms.</p><p>Focus on writing clean and maintainable API logic. This will help you as your app grows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cefbec97a23" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/api-integration-fetching-data-and-connecting-to-backend-3cefbec97a23">API Integration: Fetching Data and Connecting to Backend</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forms, Validation, and User Input Handling]]></title>
            <link>https://towardsdev.com/forms-validation-and-user-input-handling-22aafa68dd64?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/22aafa68dd64</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Tue, 21 Apr 2026 06:52:14 GMT</pubDate>
            <atom:updated>2026-04-23T13:08:00.220Z</atom:updated>
            <content:encoded><![CDATA[<p>So far, you’ve learned how to build layouts and navigate between screens. Now it’s time to handle something every real app needs: <strong>user input</strong>.</p><p>Whether it’s a login form, signup page, or profile update, forms are a core part of mobile applications.</p><h3>Why Forms Matter</h3><p>Forms are how users interact with your app.</p><p>They allow users to:</p><ul><li>Enter data</li><li>Submit information</li><li>Update their profile</li><li>Log in or register</li></ul><p>Handling forms properly makes your app feel professional and reliable.</p><h3>Basic Form Example</h3><p>Let’s start with a simple form using TextInput.</p><pre>import { useState } from &#39;react&#39;;<br>import { View, TextInput, Button } from &#39;react-native&#39;;</pre><pre>export default function App() {<br>  const [name, setName] = useState(&#39;&#39;);</pre><pre>  const handleSubmit = () =&gt; {<br>    console.log(name);<br>  };</pre><pre>  return (<br>    &lt;View style={{ padding: 20 }}&gt;<br>      &lt;TextInput<br>        placeholder=&quot;Enter your name&quot;<br>        value={name}<br>        onChangeText={setName}<br>        style={{ borderWidth: 1, marginBottom: 10 }}<br>      /&gt;</pre><pre>      &lt;Button title=&quot;Submit&quot; onPress={handleSubmit} /&gt;<br>    &lt;/View&gt;<br>  );<br>}</pre><pre>Give feedback</pre><h3>Handling Multiple Inputs</h3><p>Most forms have more than one field.</p><pre>const [email, setEmail] = useState(&#39;&#39;);<br>const [password, setPassword] = useState(&#39;&#39;);</pre><pre>&lt;TextInput<br>  placeholder=&quot;Email&quot;<br>  value={email}<br>  onChangeText={setEmail}<br>/&gt;</pre><pre>&lt;TextInput<br>  placeholder=&quot;Password&quot;<br>  value={password}<br>  onChangeText={setPassword}<br>  secureTextEntry<br>/&gt;</pre><h3>What is Validation?</h3><p>Validation ensures that user input is correct before submitting.</p><p>For example:</p><ul><li>Email should be valid</li><li>Password should not be empty</li><li>Required fields should be filled</li></ul><h3>Simple Validation Example</h3><pre>const handleSubmit = () =&gt; {<br>  if (!email || !password) {<br>    alert(&quot;All fields are required&quot;);<br>    return;<br>  }</pre><pre>  console.log(email, password);<br>};</pre><h3>Email Format Validation</h3><pre>const isValidEmail = (email) =&gt; {<br>  return /\S+@\S+\.\S+/.test(email);<br>};</pre><pre>if (!isValidEmail(email)) {<br>  alert(&quot;Invalid email&quot;);<br>}</pre><h3>Showing Errors in UI</h3><p>Instead of alerts, show errors inside the app.</p><pre>const [error, setError] = useState(&#39;&#39;);</pre><pre>const handleSubmit = () =&gt; {<br>  if (!email) {<br>    setError(&quot;Email is required&quot;);<br>    return;<br>  }</pre><pre>  setError(&#39;&#39;);<br>};</pre><pre>{error ? &lt;Text style={{ color: &#39;red&#39; }}&gt;{error}&lt;/Text&gt; : null}</pre><h3>Using Formik (Professional Approach)</h3><p>For larger forms, handling everything manually becomes messy.</p><p>Formik simplifies form handling.</p><h3>Install:</h3><pre>npm install formik</pre><h3>Example with Formik</h3><pre>import { Formik } from &#39;formik&#39;;<br>import { View, TextInput, Button } from &#39;react-native&#39;;</pre><pre>&lt;Formik<br>  initialValues={{ email: &#39;&#39;, password: &#39;&#39; }}<br>  onSubmit={(values) =&gt; console.log(values)}<br>&gt;<br>  {({ handleChange, handleSubmit, values ,blur, }) =&gt; (<br>    &lt;View&gt;<br>      &lt;TextInput<br>        placeholder=&quot;Email&quot;<br>        value={values.email}<br>        onChangeText={handleChange(&#39;email&#39;)}<br>      /&gt;</pre><pre>      &lt;TextInput<br>        placeholder=&quot;Password&quot;<br>        value={values.password}<br>        onChangeText={handleChange(&#39;password&#39;)}<br>      /&gt;</pre><pre>      &lt;Button title=&quot;Submit&quot; onPress={handleSubmit} /&gt;<br>    &lt;/View&gt;<br>  )}<br>&lt;/Formik&gt;</pre><h3>Using Yup for Validation</h3><p>Formik works best with Yup.</p><h3>Install:</h3><pre>npm install yup</pre><h3>Example:</h3><pre>import * as Yup from &#39;yup&#39;;</pre><pre>const schema = Yup.object().shape({<br>  email: Yup.string().email().required(),<br>  password: Yup.string().min(4).required(),<br>});</pre><h3>Best Practices</h3><p>To build clean forms:</p><ul><li>Keep state organized</li><li>Validate before submit</li><li>Show user-friendly errors</li><li>Avoid unnecessary re-renders</li><li>Use Formik for complex forms</li></ul><h3>Common Mistakes</h3><p>Some things to avoid:</p><ul><li>Not validating input</li><li>Using too many alerts</li><li>Not handling empty fields</li><li>Mixing UI and validation logic</li></ul><h3>Practice Task</h3><p>Build a simple login form:</p><ul><li>Email field</li><li>Password field</li><li>Submit button</li><li>Validation for both</li></ul><h3>Conclusion</h3><p>Forms are one of the most important parts of any app. Learning how to handle input and validation properly will help you build real-world applications with confidence.</p><p>Start simple, then move to tools like Formik and Yup as your forms grow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22aafa68dd64" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/forms-validation-and-user-input-handling-22aafa68dd64">Forms, Validation, and User Input Handling</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigation in React Native: Stack and Tab Navigation]]></title>
            <link>https://towardsdev.com/navigation-in-react-native-stack-and-tab-navigation-292064719a67?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/292064719a67</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactnative-app]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Mon, 20 Apr 2026 07:58:21 GMT</pubDate>
            <atom:updated>2026-04-27T11:19:01.060Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*6dxPGvw-fF2a1BeG_4TQFA.png" /><figcaption>Navigation in React Native: Stack and Tab Navigation</figcaption></figure><p>Once your app has more than one screen, navigation becomes essential. Users need a way to move between screens smoothly, just like in any real mobile application.</p><p>In React Native, navigation is handled using libraries, and the most widely used one is <strong>React Navigation</strong>.</p><h3>Why Navigation is Important</h3><p>Without navigation, your app is just a single screen. Real apps require:</p><ul><li>Moving between pages</li><li>Going back to previous screens</li><li>Organizing features into sections</li></ul><p>Navigation gives structure to your application.</p><h3>Installing React Navigation</h3><p>First, install the required packages:</p><pre>npm install @react-navigation/native<br>npx expo install react-native-screens react-native-safe-area-context</pre><p>Then install stack navigation:</p><pre>npm install @react-navigation/native-stack</pre><h3>Setting Up Navigation Container</h3><p>Wrap your app with NavigationContainer.</p><pre>import { NavigationContainer } from &#39;@react-navigation/native&#39;;</pre><pre>export default function App() {<br>  return (<br>    &lt;NavigationContainer&gt;<br>      {/* Navigation goes here */}<br>    &lt;/NavigationContainer&gt;<br>  );<br>}</pre><h3>Stack Navigation</h3><p>Stack navigation works like a stack of screens.</p><ul><li>You open a new screen → it goes on top</li><li>You go back → it pops off</li></ul><h3>Example: Stack Navigator</h3><pre>import { createNativeStackNavigator } from &#39;@react-navigation/native-stack&#39;;<br>import { NavigationContainer } from &#39;@react-navigation/native&#39;;<br>import { View, Text, Button } from &#39;react-native&#39;;</pre><pre>const Stack = createNativeStackNavigator();</pre><pre>function HomeScreen({ navigation }) {<br>  return (<br>    &lt;View&gt;<br>      &lt;Text&gt;Home Screen&lt;/Text&gt;<br>      &lt;Button<br>        title=&quot;Go to Details&quot;<br>        onPress={() =&gt; navigation.navigate(&#39;Details&#39;)}<br>      /&gt;<br>    &lt;/View&gt;<br>  );<br>}</pre><pre>function DetailsScreen() {<br>  return (<br>    &lt;View&gt;<br>      &lt;Text&gt;Details Screen&lt;/Text&gt;<br>    &lt;/View&gt;<br>  );<br>}</pre><pre>export default function App() {<br>  return (<br>    &lt;NavigationContainer&gt;<br>      &lt;Stack.Navigator&gt;<br>        &lt;Stack.Screen name=&quot;Home&quot; component={HomeScreen} /&gt;<br>        &lt;Stack.Screen name=&quot;Details&quot; component={DetailsScreen} /&gt;<br>      &lt;/Stack.Navigator&gt;<br>    &lt;/NavigationContainer&gt;<br>  );<br>}</pre><h3>Passing Data Between Screens</h3><pre>navigation.navigate(&#39;Details&#39;, { name: &#39;John&#39; });</pre><p>Receive it:</p><pre>function DetailsScreen({ route }) {<br>  const { name } = route.params;</pre><pre>  return &lt;Text&gt;{name}&lt;/Text&gt;;<br>}</pre><h3>Tab Navigation</h3><p>Tabs are used for main sections of an app, like:</p><ul><li>Home</li><li>Profile</li><li>Settings</li></ul><h3>Install Tabs</h3><pre>npm install @react-navigation/bottom-tabs</pre><h3>Example: Bottom Tabs</h3><pre>import { createBottomTabNavigator } from &#39;@react-navigation/bottom-tabs&#39;;</pre><pre>const Tab = createBottomTabNavigator();</pre><pre>function Home() {<br>  return &lt;Text&gt;Home&lt;/Text&gt;;<br>}</pre><pre>function Profile() {<br>  return &lt;Text&gt;Profile&lt;/Text&gt;;<br>}</pre><pre>export default function App() {<br>  return (<br>    &lt;NavigationContainer&gt;<br>      &lt;Tab.Navigator&gt;<br>        &lt;Tab.Screen name=&quot;Home&quot; component={Home} /&gt;<br>        &lt;Tab.Screen name=&quot;Profile&quot; component={Profile} /&gt;<br>      &lt;/Tab.Navigator&gt;<br>    &lt;/NavigationContainer&gt;<br>  );<br>}</pre><h3>Combining Stack and Tabs</h3><p>In real apps, you often combine both.</p><p>Example:</p><ul><li>Tabs for main sections</li><li>Stack inside each tab</li></ul><p>This gives a professional structure.</p><h3>Common Mistakes</h3><p>Some common issues developers face:</p><ul><li>Forgetting NavigationContainer</li><li>Using wrong navigator type</li><li>Not passing props correctly</li><li>Overcomplicating navigation early</li></ul><h3>Best Practices</h3><ul><li>Keep navigation simple at first</li><li>Use meaningful screen names</li><li>Separate navigation logic into its own file</li><li>Avoid deep nesting</li></ul><h3>Practice Task</h3><p>Try building this:</p><ul><li>Home screen</li><li>Details screen</li><li>Bottom tabs with 2 sections</li></ul><p>Combine stack + tabs if possible.</p><h3>Conclusion</h3><p>Navigation is the backbone of any mobile app. Once you understand stack and tab navigation, you can build multi-screen applications with proper structure.</p><p>Take time to practice moving between screens and passing data. This will be used in almost every project you build.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=292064719a67" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/navigation-in-react-native-stack-and-tab-navigation-292064719a67">Navigation in React Native: Stack and Tab Navigation</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Core Components: ScrollView, FlatList, Image, and TextInput]]></title>
            <link>https://towardsdev.com/core-components-scrollview-flatlist-image-and-textinput-634b28137f75?source=rss-a8d02371a24e------2</link>
            <guid isPermaLink="false">https://medium.com/p/634b28137f75</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Chandan | Full-Stack Developer]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 08:17:51 GMT</pubDate>
            <atom:updated>2026-04-24T13:14:29.433Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBsp8Pw7aENYgRE7r3dOHg.png" /><figcaption>Core Components: ScrollView, FlatList, Image, and TextInput</figcaption></figure><p>By now, you understand the basics and layout system. The next step is learning the core components that you will use in almost every real app.</p><p>These components help you handle:</p><ul><li>Lists of data</li><li>User input</li><li>Images</li><li>Scrolling content</li></ul><p>Mastering them will make your app feel real.</p><h3>Why Core Components Matter</h3><p>In web development, you use elements like input, img, and div.<br> In React Native, these are replaced with specialized components.</p><p>The most commonly used ones are:</p><ul><li>ScrollView</li><li>FlatList</li><li>Image</li><li>TextInput</li></ul><h3>ScrollView</h3><p>ScrollView is used when you have content that doesn’t fit on the screen.</p><h3>Example:</h3><pre>import { ScrollView, Text } from &#39;react-native&#39;;</pre><pre>export default function App() {<br>  return (<br>    &lt;ScrollView&gt;<br>      &lt;Text&gt;Item 1&lt;/Text&gt;<br>      &lt;Text&gt;Item 2&lt;/Text&gt;<br>      &lt;Text&gt;Item 3&lt;/Text&gt;<br>      &lt;Text&gt;Item 4&lt;/Text&gt;<br>      &lt;Text&gt;Item 5&lt;/Text&gt;<br>    &lt;/ScrollView&gt;<br>  );<br>}</pre><h3>When to Use ScrollView</h3><ul><li>Small lists</li><li>Static content</li><li>Forms</li></ul><h3>Limitation</h3><p>ScrollView renders everything at once, so it is not ideal for large lists.</p><h3>FlatList</h3><p>FlatList is used for large or dynamic lists. It is optimized for performance.</p><h3>Example:</h3><pre>import { FlatList, Text } from &#39;react-native&#39;;</pre><pre>export default function App() {<br>  const data = [<br>    { id: &#39;1&#39;, name: &#39;John&#39; },<br>    { id: &#39;2&#39;, name: &#39;Jane&#39; },<br>    { id: &#39;3&#39;, name: &#39;Alex&#39; },<br>  ];</pre><pre>  return (<br>    &lt;FlatList<br>      data={data}<br>      keyExtractor={(item) =&gt; item.id}<br>      renderItem={({ item }) =&gt; &lt;Text&gt;{item.name}&lt;/Text&gt;}<br>    /&gt;<br>  );<br>}</pre><h3>Why FlatList is Better</h3><ul><li>Loads items lazily</li><li>Better performance</li><li>Handles large data smoothly</li></ul><h3>Image Component</h3><p>Used to display images in your app.</p><h3>Local Image:</h3><pre>import { Image } from &#39;react-native&#39;;</pre><pre>&lt;Image<br>  source={require(&#39;./assets/image.png&#39;)}<br>  style={{ width: 100, height: 100 }}<br>/&gt;</pre><h3>Online Image:</h3><pre>&lt;Image<br>  source={{ uri: &#39;https://example.com/image.jpg&#39; }}<br>  style={{ width: 200, height: 200 }}<br>/&gt;</pre><h3>Important Note</h3><p>You must always define width and height for images.</p><h3>TextInput</h3><p>TextInput is used to take input from the user.</p><h3>Example:</h3><pre>import { TextInput } from &#39;react-native&#39;;</pre><pre>&lt;TextInput<br>  placeholder=&quot;Enter your name&quot;<br>  style={{<br>    borderWidth: 1,<br>    padding: 10,<br>    margin: 10<br>  }}<br>/&gt;</pre><h3>Controlled Input Example</h3><pre>import { useState } from &#39;react&#39;;<br>import { TextInput, View } from &#39;react-native&#39;;</pre><pre>export default function App() {<br>  const [name, setName] = useState(&#39;&#39;);</pre><pre>  return (<br>    &lt;View&gt;<br>      &lt;TextInput<br>        value={name}<br>        onChangeText={setName}<br>        placeholder=&quot;Enter name&quot;<br>      /&gt;<br>    &lt;/View&gt;<br>  );<br>}</pre><h3>Combining Everything (Mini Example)</h3><pre>import { View, FlatList, Text, TextInput, Image } from &#39;react-native&#39;;<br>import { useState } from &#39;react&#39;;</pre><pre>export default function App() {<br>  const [text, setText] = useState(&#39;&#39;);</pre><pre>  const data = [<br>    { id: &#39;1&#39;, name: &#39;Student 1&#39; },<br>    { id: &#39;2&#39;, name: &#39;Student 2&#39; }<br>  ];</pre><pre>  return (<br>    &lt;View style={{ flex: 1, padding: 20 }}&gt;<br>      &lt;TextInput<br>        placeholder=&quot;Search...&quot;<br>        value={text}<br>        onChangeText={setText}<br>        style={{ borderWidth: 1, marginBottom: 10 }}<br>      /&gt;</pre><pre>      &lt;FlatList<br>        data={data}<br>        keyExtractor={(item) =&gt; item.id}<br>        renderItem={({ item }) =&gt; &lt;Text&gt;{item.name}&lt;/Text&gt;}<br>      /&gt;</pre><pre>      &lt;Image<br>        source={{ uri: &#39;https://via.placeholder.com/100&#39; }}<br>        style={{ width: 100, height: 100 }}<br>      /&gt;<br>    &lt;/View&gt;<br>  );<br>}</pre><h3>When to Use What</h3><ul><li>ScrollView → small content</li><li>FlatList → large or dynamic lists</li><li>Image → display images</li><li>TextInput → user input</li></ul><h3>Common Mistakes</h3><ul><li>Using ScrollView for large data</li><li>Forgetting keyExtractor in FlatList</li><li>Not setting image dimensions</li><li>Not controlling TextInput state</li></ul><h3>Practice Task</h3><p>Build a simple screen:</p><ul><li>Input field at top</li><li>List of names below</li><li>Image at bottom</li></ul><p>Try combining all components.</p><h3>Conclusion</h3><p>These core components are the building blocks of almost every React Native app. Once you are comfortable with them, you can start building real features like forms, lists, and dashboards.</p><p>Focus on practice. The more you use them, the more natural they will feel.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=634b28137f75" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/core-components-scrollview-flatlist-image-and-textinput-634b28137f75">Core Components: ScrollView, FlatList, Image, and TextInput</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>