Build EVERY Layout with Expo Router

Поделиться
HTML-код
  • Опубликовано: 27 сен 2024
  • Let's dive deep into Expo Router and create a file-based routing for our React Native app. We cover tabs, drawers, nested layouts, modals and even building universal React Native apps with web layout and CSS!
    🔥 Learn React Native FAST: galaxies.dev
    #############################
    ❤️ You can also find me on:
    Instagram: / simongrimm_
    Twitter: / schlimmson
    #############################
    #reactnative #reactjs #expo

Комментарии • 102

  • @MarlonEnglemam
    @MarlonEnglemam 4 месяца назад +7

    I cant pretend I like file based routing in Expo anymore. No matter how many apps I've coded with that system, it always breaks screens and layouts and takes minutes to find the issue. Wish we all could stop all this madness around file based routing, I dont understand why everyone is so obsessed with it

  • @darenbaker4569
    @darenbaker4569 Год назад +1

    After watching this over the last 24 hours I think that this format was perfection, working with native and web, really works. This has helped me and I am going to recommend this video to my fellow developers next week as we are making the move to universal apps with expo. Fantastic work

    • @galaxies_dev
      @galaxies_dev  Год назад

      Wow thank you so much, really happy to hear!

    • @Tyler-pz2ol
      @Tyler-pz2ol 7 месяцев назад

      By universal apps - you mean web and mobile from just the expo code? Does this replace NextJS?

  • @pavelesonic
    @pavelesonic Год назад +2

    I've been studying/trying the new Expo Route v2 for the last few days, and thanks to your videos, I've gained a pretty good grasp of it. This stream was a great recap of everything I've learned. So, thank you so much for your work. It is really helpful and meaningful. :)

  • @DestinationDub
    @DestinationDub 11 месяцев назад +3

    You have helped me SOOOOOOO much, Simon. Thank you from the bottom of my heart!

  • @jesussanchez6628
    @jesussanchez6628 Год назад +6

    I was really struggling with having a drawer and tabs on a dashboard screen. This video is exactly what i needed, earned a like and follow. Thank you sir!

  • @BeastBishop
    @BeastBishop 9 месяцев назад +1

    Thank you for this great stream. I have developed apps using the old navigation. I tried using router myself but I ended up with 3 broken projects when implementing tabs to drawers or drawers to tabs. I now understand what I was missing.

    • @galaxies_dev
      @galaxies_dev  8 месяцев назад

      Glad I could help you out :)

  • @AndresJesse
    @AndresJesse Год назад +1

    Man, thanks!! You just solved a problem that blowed my mind for days! That nested index was also causing self-redirects here.

  • @oakisCodeTz
    @oakisCodeTz 2 месяца назад +1

    What's up with presentation='modal' on android? it doesnt seem to work.

  • @tomatdoras
    @tomatdoras 11 месяцев назад +1

    Followed along, have now subscribed. Can't wait to also head over to Galaxies and see what else I can learn. As a web dev trying to get into apps, your videos are appreciated

    • @galaxies_dev
      @galaxies_dev  11 месяцев назад

      Thank you so much! Let me know whenever you encounter problems :)

  • @tanupathak2151
    @tanupathak2151 Год назад

    Thank you for making these kind of content. You gained a loyal subscriber today!

  • @ExpoDev_Dash
    @ExpoDev_Dash 3 месяца назад +3

    00:06 Deep dive into Expo router features.
    02:26 Expo Router enables clean navigation in a single project
    06:43 Expo CLI adds necessary features for Expo Router to function correctly
    08:58 Using Expo Router version 2 and setting up without integrated tabs template
    13:42 Setting app.json type routes to true for code compilation
    16:06 Setting up file-based routing for faster project setup
    20:54 Using Expo Router for navigation
    23:10 Group elements for file-based routing
    27:29 Setting up tab bar and defining icons using Expo Router
    30:01 Exploring icon styling and customization in Expo Router
    34:35 Implement the layout file to customize the page
    36:56 Issues with lockout navigation
    42:17 Issue with multiple index pages causing routing problems
    44:41 Adding a modal page in Expo Router
    49:20 Understanding different levels and confusion with Expo Router
    51:31 Creating layouts with Expo Router for navigation
    55:44 Implementing platform specific modules for web and mobile apps
    58:11 Implementing navigation and rendering content using Expo Router
    1:02:54 Adding CSS support with Metro config
    1:05:18 Using platform-specific code for better structure and functionality.
    1:09:59 Expo Router provides solutions for using custom components for web and mobile.
    1:12:28 Expo Router allows for universal app setup with file-based routing and customization for the web.
    1:17:28 Expo Router v3 will include API routes for secure environment variables and requests.
    1:19:38 Implementing styling with CSS for page layouts
    1:24:00 Encourage feedback and engagement from viewers
    Crafted by Merlin AI.

  • @drugoviic
    @drugoviic Месяц назад

    this stream is pure gold

  • @sunnysingha1154
    @sunnysingha1154 7 месяцев назад +1

    Wtched it full like a movie❤..wnt more like this.. waiting for more

  • @mauricearida9001
    @mauricearida9001 9 месяцев назад +3

    why didn't you share the code bro 😢

  • @subhamkundu8234
    @subhamkundu8234 Месяц назад

    hey brother Im totally confused that what I do next I just complete typescript now I learn the basics of react-native pls I know the react I dont know node, express, mongodb whaty should u prefer could I jump direct in a react-native project ????

  • @kitkottin
    @kitkottin Месяц назад +1

    21:31 who else thought they got a message from discord
    also thanks for the video I use this a tutoriol before my internship project but pls speak slower and explain more I have to rewatch 100 times after every step

  • @akosbalint3485
    @akosbalint3485 8 месяцев назад +1

    Could anybody tell me, how to use and at the same(root) _layout file?
    I would like to set the styles(background) for all the screens in one place and configure the stack as well.

  • @SamsonWoldeyohannes
    @SamsonWoldeyohannes 3 дня назад +1

    Same here! I just can't call it "X"

  • @codewithtae6637
    @codewithtae6637 7 месяцев назад +2

    Appreciate the video!

  • @Norfeldt
    @Norfeldt 11 месяцев назад +1

    This was magic 🪄 to watch. Thank you so much. Will be looking so much forward to trying this out myself on the next RN (expo) project I start

    • @galaxies_dev
      @galaxies_dev  11 месяцев назад +1

      Awesome, and hope everything works for you!

  • @Niletixofficial
    @Niletixofficial 6 месяцев назад

    How do i add the authprovider here?

  • @jayshivsahu
    @jayshivsahu 7 месяцев назад

    Hi Simon! Suppose I have 5 pages: pg1, pg2, ...pg5, all are inside a stack layout of Expo Router v3. I reached pg3 by navigating one after another from pg1. I want to display this page as a splash screen for 5 seconds. After 5 seconds, I want to navigate to pg5.
    I want now when I click back from the header of pg5 or from the device back button, it should navigate directly to pg3, not to pg4. In simple terms, I want to remove pg4 from my stack history. In the Expo documentation, they have mentioned to use router.dismiss, but it does not work for me.
    Could you please give me any ideas?
    Thanks in advance.

  • @ihzakarunia2408
    @ihzakarunia2408 5 месяцев назад

    hey, do you know how to give transition when transitioning between tabs?

  • @MsToptool
    @MsToptool Год назад

    Expo router is cool but I am facing an issue when redirecting to a Stack screen where the animations don't work, by animations I mean :

  • @msrajawat298
    @msrajawat298 5 месяцев назад

    I am working on expo router trying to develop android application. During development I Observe that if I am creating any new file it is showing in menu, like if I am using tab navigation using expo router and created a new file which is showing as menu in bottom tab. Similarly in drawer menu also.
    Can anyone help me how I can fix that issue ?
    However maybe it is default behaviour of expo router but I don't want to show each file in menu.

    • @galaxies_dev
      @galaxies_dev  5 месяцев назад +1

      You can set the href of a stack to null so it's not rendered in a tab bar, or set a styling for that item when using a drawer to hide it. Otherwise, all files automatically show up in those layouts!

  • @ManasTunga
    @ManasTunga 6 месяцев назад +1

    Thanks for making this video.

    • @galaxies_dev
      @galaxies_dev  6 месяцев назад

      My pleasure. give it a share :)

  • @adelashour3253
    @adelashour3253 7 месяцев назад

    ExpoMetroConfig.loadAsync is not a function
    can any body tell?

  • @himavarshanreddy1341
    @himavarshanreddy1341 11 месяцев назад

    "I have 3 tabs - home, cart, profile. cart and profile are folder where i have multiple pages. now when i can click on the cart tab it shows tab bar by default and when i go the second page which is on the cart folder i don't want see the tab bar. How can i achieve this?

    • @galaxies_dev
      @galaxies_dev  11 месяцев назад +1

      Then those pages should not be children of the tabs layout folder!

  • @AndreyEscobar
    @AndreyEscobar 11 месяцев назад

    I have a question...
    If the index is the first page to show, i have to put my Login in this page...
    And if i get the authentication in my firebase, i show the first page of the user loged...
    So, i´m trying to choose this page of the user logged....
    What page i must choose? The page './(tabs)/(one)/one'?
    Is any problem that´s page is in the second layer of the tree...
    I try to set the page './(tabs)/(one)/one' for the user loged, but i lost the tabs in the baseboad...and i don´t know why the tabs is not shown....is any problem to this?

    • @AndreyEscobar
      @AndreyEscobar 11 месяцев назад

      import {View, Text, Button, StyleSheet} from 'react-native'
      import { Stack, Link, useRouter } from 'expo-router';
      import React, {useState, useEffect} from "react";
      import { firebase } from './config';
      import Login from './login';
      import One from './(tabs)/(one)/one';
      const Page = () => {
      const [initializing, setInitializing] = useState(true);
      const [user, setUser] = useState(true);
      const router = useRouter();
      function onAuthStateChanged(user) {
      setUser(user);
      if (initializing) setInitializing(false);
      }
      useEffect(() => {
      const subscriber = firebase.auth().onAuthStateChanged(onAuthStateChanged);
      return subscriber
      }, []);
      if (initializing) return null;
      if (!user){
      return(

      );
      }
      return(

      );
      }
      export default Page

  • @ayin86cn
    @ayin86cn 11 месяцев назад +1

    这个视频太棒了,this is awesome video. thank you!

  • @darkwolf4074
    @darkwolf4074 10 месяцев назад

    Hello Simon, I'm wondering what plugin you are using in vscode that keeps giving you hints on your code please, thanks

    • @galaxies_dev
      @galaxies_dev  10 месяцев назад

      That will be Ghub Copilot!

  • @michelecocucciocatania
    @michelecocucciocatania 11 месяцев назад

    Hey. Great video! Did you find a solution for the "logout" issue apart from putting () around the routes? I had the same issue in our project and I ended up having to create a duplicated page and navigate to that when I wanted to take the user to the first screen after logging out. Of course that's not ideal. I don't know if it's a bug from Expo Router or an expect behaviour as it navigates to the first "index" file that he finds

    • @galaxies_dev
      @galaxies_dev  11 месяцев назад

      Yeah I think navigating to the first index file is the problem, think there was an open github issue!

  • @mishen-thakshana
    @mishen-thakshana 8 месяцев назад

    Can you do a video on background actions

  • @coskunbaris946
    @coskunbaris946 Год назад

    What do you use to colorize your cursor?

  • @hendazzler
    @hendazzler 3 месяца назад +1

    Good content but the music really messes with watching at 2x speed and it's a bit loud relatively to your speaking voice

    • @galaxies_dev
      @galaxies_dev  3 месяца назад +2

      Sorry, will try to improve it next time!

  • @BBTR_
    @BBTR_ 9 месяцев назад

    native navigation or expo router?

    • @galaxies_dev
      @galaxies_dev  8 месяцев назад

      Umm it's both in the title and thumbnail? We are using Expo Router, and I recommend it!

  • @SourVD
    @SourVD 4 месяца назад

    This was so helpful, I find Expo's documentation to be the worst I've ever seen

  • @j7512
    @j7512 10 месяцев назад

    How do you do this when your pages are in sub directories?

    • @galaxies_dev
      @galaxies_dev  10 месяцев назад

      The directories are the path, every folder/file is a URL path component!

    • @j7512
      @j7512 10 месяцев назад

      Thanks!@@galaxies_dev I've noticed that the drawbacks of using react native is that you can't have pixel perfect accuracy. If I want to move a text 2 pixels to the right, I can't do that

  • @mitchy3686
    @mitchy3686 9 месяцев назад

    Do you have this in GitHub?

  • @regularyt-pz4ki
    @regularyt-pz4ki 9 месяцев назад

    perfect up to the tabs part next time prepare before hand

  • @fallanstar
    @fallanstar Год назад

    Why you prefer Expo instead of CLI 80 percent apps are developed with CLI in market so plz start CLI tutorial

    • @Flash136
      @Flash136 Год назад +6

      Expo is the future of React Native

  • @gerryramosftw
    @gerryramosftw 15 дней назад +1

    So glad I found this video! The best explanation on youtube about expo file based routing. i love how you included so many use cases, i needed all of them 🙏

  • @JonSoftware
    @JonSoftware 10 месяцев назад +1

    Is the source code for this video available? If so, where can I find it.

  • @dylandiaz4786
    @dylandiaz4786 11 месяцев назад +3

    I really still don't see the need for react native to be compatible with the web, we already have plenty of Framework for websites and react native is very far from them, I would never use react native for a web platform

    • @galaxies_dev
      @galaxies_dev  11 месяцев назад +6

      If you want to have just one code base because you don't have a big team, it's a viable solution!

    • @neneodonkor
      @neneodonkor 5 месяцев назад

      @@galaxies_dev it adds another level of unnecessary complexity.

    • @werty2172
      @werty2172 5 месяцев назад

      @@neneodonkorskill issue

    • @colmukrainec
      @colmukrainec 2 месяца назад

      @@neneodonkorI’m just learning atm, but why? Doesn’t it just add extra options for how your code can be used? They don’t have to be used that way I assume…

  • @werther3974
    @werther3974 Год назад +2

    !!!! What if i want drawer tab inside each and every tab page?

    • @jesussanchez6628
      @jesussanchez6628 Год назад

      Would like to know this as well

    • @galaxies_dev
      @galaxies_dev  11 месяцев назад

      You would have to define a drawer layout either around or inside the tab!

    • @juniorMr
      @juniorMr 10 месяцев назад

      Ca i follow along using normal js?

  • @pranitmane
    @pranitmane 8 месяцев назад +2

    very helpful! thanks ❤

  • @lucifer-5ybtn
    @lucifer-5ybtn 5 месяцев назад

    Do you know how to implement a feature where if you click on a link within a modal (a screen with presentation=modal) and close the modal and redirect to the intended screen after a tiny delay (500ms for example)
    When I do that, it happens but the new screen which gets pushed to the stack doesn’t have a back button.
    For reference: In Whatsapp on iOS, when you click on a contact in the new chat screen (modal) it closes the modal and then redirects to the chat page after a short delay

  • @Amitkumar-ps1dt
    @Amitkumar-ps1dt Год назад +2

    extremely helpful videos simon, Thank you

  • @galaxies_dev
    @galaxies_dev  10 месяцев назад

    Become a master of the new Expo Router in my LIVE Workshop: ti.to/galaxiesdev/react-native-expo-router-workshop

  • @satyak1337
    @satyak1337 2 месяца назад +1

    This is by far best tutorial on expo router. Thanks you. I switched from npx to bun after this video.

    • @galaxies_dev
      @galaxies_dev  Месяц назад

      If you enjoyed it, could you share the channel with your RN buddies? ️👋
      Thanks!

  • @marcosmoura2667
    @marcosmoura2667 11 месяцев назад +1

    Thank you for the excellent content, Waiting for the customized web version! I'm from Brazil

  • @silverheart573
    @silverheart573 3 месяца назад

    Is there anyway to use create-expo-app using JS default set up rather than Typescript?

    • @galaxies_dev
      @galaxies_dev  3 месяца назад

      Not sure, but I also wouldn't recommend it tbh

  • @AftabShaik-r4z
    @AftabShaik-r4z 5 месяцев назад

    How can I make the Top Tab Scroll upwards whenever I scroll up on the screen.
    For example: The RUclips Channel Screen has a header, then below it a similar Top Tab Navigation Bar and then below the bar the content according to the tab of Top Tab Nav. When u scroll on that screen the content and the top tab and the header all move up

  • @JulioGarcia-sephirothtbm
    @JulioGarcia-sephirothtbm Год назад

    I had a really weird issues before with the physical back button on Android, maybe my file structure was wrong thank for all the content I'm gonna give another try to the Expo Router

  • @welly_de
    @welly_de Год назад

    how to have tabs only on the parent screen of the stack not the childs and with autocomplete routing still worked

  • @renekutter7562
    @renekutter7562 10 месяцев назад

    Ich versuche seit bestimmt 5 Stunden eine einfache Menü-Struktur aufzubauen, aber ich bekomme es einfach nicht hin🙁 Hier im Video hat der entry point ja eine Stack Navigation. Ich möchte allerdings das ich mit einer Tab Navigation starte. Eine der Seiten in der Tab Navigation soll eine Stack Navigation beinhalten. Am besten ohne Redirect. Wie realisiere ich das? Wäre dir sehr dankbar ❤

  • @hanibal43
    @hanibal43 Год назад

    Would love to see how this navigation would work with tamagui's xstack/ ystack etc.

    • @galaxies_dev
      @galaxies_dev  11 месяцев назад

      Yeah will try out Tamagui soon!

  • @MrDJsArcade
    @MrDJsArcade Год назад

    Hey I really meant to catch this livestream but I didn't get the notification. Great video!

    • @galaxies_dev
      @galaxies_dev  Год назад +1

      Next time!

    • @MrDJsArcade
      @MrDJsArcade Год назад

      @@galaxies_dev definitely. And where are you from? Or based? Your accent is peculiar.