React Native Tab Bar Routing with Expo Router

  Рет қаралды 55,742

Simon Grimm

Simon Grimm

Жыл бұрын

Learn to use the new Expo File-based routing to create a tab bar with nested stack layouts!
🔥 Learn React Native FAST: galaxies.dev/reactnative
#############################
👨‍💻 Want to read instead of watch?
Here's the full Ionic tutorial: galaxies.dev/react-native-tab...
#############################
❤️ You can also find me on:
Instagram: / simongrimm_
Twitter: / schlimmson
Facebook: / devdactic
TikTok: / simongrimm_
Or join the Simonics Facebook group:
/ simonics
#############################

Пікірлер: 135
@ChrisPrakoso
@ChrisPrakoso 7 ай бұрын
I can't thank you enough for this! I was going on looking for all possible info on the net about how exactly to do what you are explaining here, and I just couldn't find the right info. It was a bit frustrating to say the least. But you've successfully explained it in just 10 minutes!! That's just awesome! Thank you again.
@galaxies_dev
@galaxies_dev 7 ай бұрын
Thank you so much Chris!!
@rapepongpitijaroonpong1036
@rapepongpitijaroonpong1036 11 ай бұрын
The contents in this channel is very infomative,it really helps me understand react native and able to go on. and I like how you explain in each part which important but most tutorial i found don't have.
@galaxies_dev
@galaxies_dev 10 ай бұрын
Happy to hear that and thank you for the kind words - more React Native coming soon :)
@michelro
@michelro 11 ай бұрын
This is exactly what I was looking for, thanks a lot. I think if you need to say home/index when you don’t have the layout file and that’s why you were getting a warning.
@galaxies_dev
@galaxies_dev 10 ай бұрын
Yeah finally figured that out as well :D
@tusharnagar1398
@tusharnagar1398 3 ай бұрын
Thanks dear for helping me to digest cool stuff easily.
@CalvinTeixeira
@CalvinTeixeira Ай бұрын
i was getting crazy trying to create nested routes inside tabs, every time i created a new route it was creating a new tab... the point is the use of _layout.tsx inside my tab screen folder (like your /home/_layout.tsx)... thank you!!!!!!! i must to say that i've searching for a solution even the IA and even that can't help me until now!! hahahahha ty again!
@galaxies_dev
@galaxies_dev 29 күн бұрын
Great to hear!
@Baconbrix
@Baconbrix 11 ай бұрын
At 3:14, if you define a React component as an anonymous function, i.e. `export default () => `, then React Refresh won't be able to restore the state inside that component correctly. This is because the function name is used as a restoration ID for components.
@galaxies_dev
@galaxies_dev 11 ай бұрын
Ahh thank you Evan!!
@mrd.j.2303
@mrd.j.2303 9 ай бұрын
What would be the better way?
@VHM_Dev
@VHM_Dev Ай бұрын
Great stuff. It actually helped me to understand how using Stack works - godsend!!
@galaxies_dev
@galaxies_dev Ай бұрын
Awesome!
@rafacanical
@rafacanical 10 ай бұрын
I was looking for this! Thanks
@galaxies_dev
@galaxies_dev 10 ай бұрын
Hope you like it!
@klincoder
@klincoder Жыл бұрын
Very useful and saved me time. Thank you.
@galaxies_dev
@galaxies_dev Жыл бұрын
Happy to help - let me know when you encounter problems!
@tomhopkinslondon
@tomhopkinslondon 3 ай бұрын
This is a really helpful intro. Many many thanks.
@galaxies_dev
@galaxies_dev 3 ай бұрын
Glad it was helpful!
@rishabh1S
@rishabh1S 3 ай бұрын
Exact Video, I needed!! Thanks Man
@galaxies_dev
@galaxies_dev 3 ай бұрын
Glad to hear it!
@edena276
@edena276 7 ай бұрын
You speak and do thing fast, love it !!!
@galaxies_dev
@galaxies_dev 7 ай бұрын
Thank you!
@brunovivaldodev
@brunovivaldodev 7 ай бұрын
Great video, and good explanation
@korkechoussama5116
@korkechoussama5116 2 ай бұрын
that was exaactly what i was looking for ty man
@galaxies_dev
@galaxies_dev Ай бұрын
Happy I could help 💪
@karldtrumpeter
@karldtrumpeter 9 ай бұрын
Thanks. This helped me a great deal.
@galaxies_dev
@galaxies_dev 9 ай бұрын
Glad I could help!
@alistairholt
@alistairholt 10 ай бұрын
You did a much better job than the docs and example repos. I spent a few hours on this as it’s completely counter intuitive to do things this way. I wouldn’t say Expo Router is anywhere near being ready for production especially given the state of the docs. It’s far simpler to just use React Navigation directly right now.
@galaxies_dev
@galaxies_dev 10 ай бұрын
It is a mindset shift, I agree. But it also simplifies things later on, so I think it's worth investing time into it - especially with Expo Router v2 out now!
@formerly_chucks
@formerly_chucks 2 ай бұрын
Dude you just saved my bacon, thank you so much for this vid!
@galaxies_dev
@galaxies_dev Ай бұрын
Any time mate!
@davidadokuru8139
@davidadokuru8139 Жыл бұрын
Thanks This is what I did to solve it. I was wondering if there was a better way 😅
@galaxies_dev
@galaxies_dev Жыл бұрын
Yeah I guess not :D
@shinypants2204
@shinypants2204 8 ай бұрын
good stuff! thank you
@galaxies_dev
@galaxies_dev 8 ай бұрын
You're welcome!
@user-sj5in5lt8s
@user-sj5in5lt8s 11 ай бұрын
This video is amazing!
@galaxies_dev
@galaxies_dev 10 ай бұрын
Thank you!!
@tikod7236
@tikod7236 10 ай бұрын
Hey thanks for your awesome video! Tell me, please, how can I connect redux in such a breakdown into files and such an architecture. I mean, exactly where should I use to push state to each page
@homerreal
@homerreal 7 ай бұрын
Simply, Thanks
@galaxies_dev
@galaxies_dev 7 ай бұрын
You are welcome!
@junioroga
@junioroga 3 ай бұрын
Thank you very much for the video, really clarifying. I have 3 questions, I am doing the migration in a medium-sized project, with a mixed navigation of Tabs with Stack in each Tab.Screen. 1 - What is the best way to do this on the Expo router? I've seen several videos, docs and tutorials and I'm skating. I'm having a lot of difficulty. 2 - Can I point out the Expo Router Stacks while keeping the screen files in the src/screens folder? 3 - How to reuse the same screen in 2 different stacks? I have a screen that repeats in 2 stacks. Could you make a video about this, I believe that most React Navigation projects have these characteristics that I am having difficulty with.
@fernandolara630
@fernandolara630 Жыл бұрын
Great video Simon! I like how you explain everything, most tutorials feel slow for people that are already familiar with React
@galaxies_dev
@galaxies_dev 11 ай бұрын
Happy I had the right pace in this video :) If you enjoyed it, maybe you can share the channel with your RN colleagues ✌️
@disminliguido
@disminliguido 11 ай бұрын
After i do the redirect with replace to a page that is inside the file (tabs) it shows this error " The action 'REPLACE' with payload {"name":"agenda"} was not handled by any navigator. Do you have a screen named 'agenda'? Do you know what could be happening?
@davidadokuru8139
@davidadokuru8139 Жыл бұрын
Thanks😊
@galaxies_dev
@galaxies_dev Жыл бұрын
You are welcome!
@IRazerIGhost
@IRazerIGhost 2 ай бұрын
Somehow the articles i followed excluded the index file which constantly gave me unmatched routes :/ Thank you for saving me and making me learn some more about expo routs!
@galaxies_dev
@galaxies_dev 2 ай бұрын
You're welcome!
@jareeshcm444
@jareeshcm444 8 ай бұрын
This sample as is didn't work for me. anywhere i can find the code? not sure what i am missing.
@JordanHesse
@JordanHesse 10 ай бұрын
Hi Simon, nice video! I was wondering if its possible to navigate between two tabs programatically without the user clicking the tab at the bottom. Say there is a button in the home tab which when the user clicks it brings the list tab into view?
@JordanHesse
@JordanHesse 10 ай бұрын
Nevermind, I figured it out. I just did router.push("route/to/tab") and it worked. I wish the documentation was more thorough.
@galaxies_dev
@galaxies_dev 10 ай бұрын
Yeah it's sparse, so if you got any questions, let us know in our Galaxies Discord channel!
@emenikeanigbogu9368
@emenikeanigbogu9368 10 ай бұрын
thank you man
@galaxies_dev
@galaxies_dev 10 ай бұрын
You're welcome!
@MrAvelino2010
@MrAvelino2010 9 ай бұрын
Congratulations 👏. Can you make a series of clean architecture in React Native projects, cover pattern like atomic design and how to apply it in React Native Projects. I have been thinking build an app for authentication I wanna use third services such firebase auth or clerk, and maybe later change to another provider, with good practices to avoid accomplishment with one specific provider follow strategy pattern or other one for a particular case Also build from scratch or use one of your existent project to convert into PWA using expo.
@galaxies_dev
@galaxies_dev 8 ай бұрын
Thanks for the ideas - noted!
@lolekakaa
@lolekakaa 8 ай бұрын
Thats great tutorial! I have a question, Is it possible to combine Tab Bar Nav with Drawer in Expo, as I spent hours to do so unsuccessfully. I would like the bottom menu to be Tab Bar Nav, and also have the option to call Drawer Nav for example as an app settings menu. Thanks in Advance!
@galaxies_dev
@galaxies_dev 8 ай бұрын
Yes absolutely! Will prepare a new stream about all the different ways to handle this!
@vitor-is5od
@vitor-is5od 9 ай бұрын
i never work with mobile development. Do you think that is a good idea start by expo? Or should I learn react-native concepts first? I only choose expo, because seems to be a new react-native patterns (something similiar to CRA in react web dev)
@galaxies_dev
@galaxies_dev 9 ай бұрын
Expo is React Native, and everyone agrees that starting with Expo is the right way in 2023! So yes, use Expo and get started with React Native - it just helps with a lot of things :)
@vitor-is5od
@vitor-is5od 9 ай бұрын
@@galaxies_dev ok! :). Thankss
@arozendojr
@arozendojr Жыл бұрын
What is the safest way to send firebase data in ionic?
@trollflix
@trollflix 10 ай бұрын
I am getting "Unmatched Route" error, even though i just copied everything you did. I think there is some diff b/n JS and TS about routing. How to make this work on JS project, without TS?
@darkwoodmovies
@darkwoodmovies 6 ай бұрын
I was having the same issue with TS. My issue was that I stupidly put the (tabs) folder under src/(tabs) instead of src/app/(tabs)
@baron_adams
@baron_adams Жыл бұрын
Hi Simon and thanks for your video. Can you make a video where you make an application with a drawer menu and with top swiper tabs in expo-router? Please
@galaxies_dev
@galaxies_dev Жыл бұрын
Top tabs, interesting. Will see what I can do!
@davidadokuru8139
@davidadokuru8139 Жыл бұрын
I did this in the same project, I brought in react navigation top tabs And it worked easily with expo router
@bakti8126
@bakti8126 11 ай бұрын
Awesome
@j4ck3
@j4ck3 9 ай бұрын
If you want to use a context. where is the best place to warp the context provider? i have my index on the same level as my login and register screens/components
@galaxies_dev
@galaxies_dev 9 ай бұрын
Context should be in the top _layout, as this will always be applied!
@valentinsoto7533
@valentinsoto7533 5 ай бұрын
Gracias hermano
@benadams8998
@benadams8998 3 ай бұрын
Great video! Did anyone manage to replace (tabs) in the header when navigating backwards to say something else like the name of the page you came from or using the word "Back"?
@galaxies_dev
@galaxies_dev 3 ай бұрын
You should be able to set the headerBackTitle
@delanick
@delanick 21 күн бұрын
Can a person use Expo Router with Javascript file sinstead of TypeScript? I prefer JS and would just like to know.
@khaledsanny4817
@khaledsanny4817 Жыл бұрын
Thank you ☝😉... make a video on expo router authentication implementation with ... i dont know... appwrite or firebase ?
@galaxies_dev
@galaxies_dev Жыл бұрын
Good idea, thanks!
@frankfu1122
@frankfu1122 Ай бұрын
Hi may I ask what extensions you used for code completion when you type ‘rnf…’
@galaxies_dev
@galaxies_dev Ай бұрын
I think it's this: marketplace.visualstudio.com/items?itemName=jundat95.react-native-snippet
@frankfu1122
@frankfu1122 Ай бұрын
@@galaxies_dev thanks!
@glaze4629
@glaze4629 7 ай бұрын
I'm really new to this concept of file based navigation, if every file is route and so do folders are, how does one organizes these files and folders? For instance i usually have screens on its own folder and sometimes within this folder i also have a components folder with ui speficic componentes to this screen as well as a styles file. How can you ignore files and folders with this system? I'd like to ignore this components folder (including all the files inside it) as well as any .tsx file of my desire, thank you before hand if you know how!
@galaxies_dev
@galaxies_dev 7 ай бұрын
You can have folders at the top level next to the app directory and have like hooks, features, whatever.. Simply somewhere else but not in that folder!
@Kevin-jc1fx
@Kevin-jc1fx Жыл бұрын
That looks cool. Is it ready for production yet?
@galaxies_dev
@galaxies_dev Жыл бұрын
Well v1 is stable as they say here: expo.github.io/router/docs/
@jeegargoyani
@jeegargoyani 5 ай бұрын
it's really helpful and easy understand for the tab bar in expo-route. can you do one thing simon can we do the live talk for more about expo route so you and we can share the ideas each other. I think sound go. what do you think @simon
@kingdre2485
@kingdre2485 8 ай бұрын
We need a run through of a top tab with expo router
@galaxies_dev
@galaxies_dev 10 ай бұрын
Become a Stellar React Native dev @ galaxies.dev 🚀
@desislavanedeva9209
@desislavanedeva9209 Ай бұрын
does expo router is used for real projects, like react navigation library? thanks
@galaxies_dev
@galaxies_dev 29 күн бұрын
Yes, you can use it :)
@cfo3049
@cfo3049 8 ай бұрын
Is it possible to implement a home/splash screen without all those tab bars and headers? I need to create a home screen with a button. This button navigates to the tab bar home screen. In React Navigation it's easy. I hope you know what I mean. best regards
@galaxies_dev
@galaxies_dev 8 ай бұрын
Sure, you can design this with layout files and simply not use a specific Stack layout for that home page! Will also do a tutorial on all things router soon again.
@z1haze
@z1haze 8 ай бұрын
so you have to keep duplicating the same layout file if you want to nest routes within the tab bar and still show the tab bar? That doesn't seem right, I hope I am misunderstanding
@galaxies_dev
@galaxies_dev 8 ай бұрын
I guess you could group them like (tab1,tab2) as the folder name and then reuse them!
@cfo3049
@cfo3049 6 ай бұрын
It would be helpfull, you make a video, about pass API-data from one tab to another tab, with TS an expo-router.🙏
@galaxies_dev
@galaxies_dev 6 ай бұрын
You would either have to use state or only pass an ID and retrieve the details on the following page!
@restenmadzalo1029
@restenmadzalo1029 8 ай бұрын
Please make a tutorial on how to customize and change theme in tamagui
@galaxies_dev
@galaxies_dev 8 ай бұрын
Alright will talk about Tamagui soon!
@artemalekseev2360
@artemalekseev2360 Жыл бұрын
How do you implement drawer in here? is it a folder like (drawer) ?
@galaxies_dev
@galaxies_dev Жыл бұрын
Yes you would define the drawer in your layout and have the files next to it, just like with tabs: expo.github.io/router/docs/migration/react-navigation/drawer-navigator
@aomafura3374
@aomafura3374 11 ай бұрын
Is it possible to transfer the tab bar from the bottom to the top of screen?
@galaxies_dev
@galaxies_dev 11 ай бұрын
I'm not sure, only thing I found is this experimental package from Evan: github.com/EvanBacon/expo-router-top-tabs
@Matheus_1582
@Matheus_1582 Жыл бұрын
Show👍
@hafsahabibs
@hafsahabibs 6 ай бұрын
If i want to hide my tab bar from One of the screens using expo router. How to do that in my react native app?
@galaxies_dev
@galaxies_dev 6 ай бұрын
Usually you want to have that screen one level higher than the tabs layout so it's wrapped in a Stack and gets pushed!
@hafsahabibs
@hafsahabibs 6 ай бұрын
@@galaxies_dev thanks for your reply. Currently, the parent route is /home/ and the dynamic route I am looking to remove the tabbar is is /home/marketplace/search/[id]. Here id is creates a dynamic route. How will the solution your provided work in this case?
@hafsahabibs
@hafsahabibs 6 ай бұрын
I figured that out, I moved [ad] folder out of the (home) directory and it worked like a charm. Thank you so much.
@oussamasethoum1665
@oussamasethoum1665 Ай бұрын
How can we have transition between tabs when navigating?
@galaxies_dev
@galaxies_dev 29 күн бұрын
I think not yet with the default tabs based on React Navigation.
@davidlintin
@davidlintin Жыл бұрын
Hi. Can you please ask your buddies @expo how to hide a tab bar within a nested stack inside a tabbar thanks 😅
@davidadokuru8139
@davidadokuru8139 Жыл бұрын
That’s what he is showing in this video I asked the question in the last video.
@paysnug4470
@paysnug4470 5 ай бұрын
The background in tab is not working please help
@victorzerefos6557
@victorzerefos6557 10 ай бұрын
Hi there Simon, thanks a lot for the tutorial. There one thing I'm a little confused about, you showed how to use a tab screen as your first screen and How can we make a first screen with no tabbar and the second screen we navigate with a tabbar?
@galaxies_dev
@galaxies_dev 10 ай бұрын
You would need a layout file above the tabs layout - I think I'll do another detailed video on it now with router v2!
@victorzerefos6557
@victorzerefos6557 10 ай бұрын
@@galaxies_dev that would be amazing! thank you very much for the amazing content you share with us on youtube!
@bullettime2808
@bullettime2808 9 ай бұрын
This works but the route outside the tabs is mounted twice and the animation also plays twice I think I'm gonna just refactor the whole app to use react navigation directly I've wasted like 6-7 hours trying to fix it
@galaxies_dev
@galaxies_dev 9 ай бұрын
Why is it mounted twice? There are some edge cases with Router that are not perfect yet, but usually it's an issue of the setup (and maybe not 100% complete docs)
@bullettime2808
@bullettime2808 8 ай бұрын
@@galaxies_dev it was a bug in expo router, It just got fixed 2 days ago with v2.0.4
@mrlectus
@mrlectus 9 ай бұрын
I am getting Attempted to navigate before mounting RootLayout Component
@Juju-ch5it
@Juju-ch5it Жыл бұрын
How did you do that 'rnfe' TAB short cut to create the index.js component?
@JEsterCW
@JEsterCW Жыл бұрын
Hes a Wizard
@galaxies_dev
@galaxies_dev 11 ай бұрын
I like how you think, but the snippets are simply part of this extension: marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets
@yucelduz4897
@yucelduz4897 8 ай бұрын
test, headerTitle: "title", headerTitleAlign: "center", headerTitleStyle: { fontSize: 25, fontWeight: 'bold', color: 'red' }, headerStyle: { backgroundColor: 'orange', } }} /> Error -> The `redirect` prop on is deprecated and will be removed. Please use `router.redirect` instead what is problem and how to fix
@ahmedhamed5093
@ahmedhamed5093 8 ай бұрын
better than docs wow, any source code for that ?
@galaxies_dev
@galaxies_dev 8 ай бұрын
All linked in the description!
@zon6423
@zon6423 11 ай бұрын
Why is my (tabs) constantly displayed on the screen?
@zon6423
@zon6423 11 ай бұрын
sorry,when I continue watching,I find the answer.
@jskaall
@jskaall 10 ай бұрын
Expo Router seems very messed up, it’s hard to understand, the docs are awful/useless and theres no big advantage on using it
@galaxies_dev
@galaxies_dev 9 ай бұрын
Trying my best to answer questions around it!
@br4ndon364
@br4ndon364 11 ай бұрын
Still don't know how to actually customize each tab
@michelro
@michelro 11 ай бұрын
You can pass options to each Tab.Screen or to the Tab to do different things with then like hiding, changing the label and much more
@mrd.j.2303
@mrd.j.2303 9 ай бұрын
Good info.. but who are you racing? Lol. I never understand why people put out tutorials and then talk and work as fast as humanly possible. I’m trying to wrap my head around these dynamic routes. With an image modal
@galaxies_dev
@galaxies_dev 9 ай бұрын
Sorry, will try to take more time to explain next time!
@mrd.j.2303
@mrd.j.2303 9 ай бұрын
@@galaxies_dev lol thanks. It’s not just you. I get that you’re excited and that’s awesome. Just a little too fast for me. Some people sound really weird at .75 speed lol
Learn Expo Router - Complete Tutorial
23:23
Cosden Solutions
Рет қаралды 46 М.
Joven bailarín noquea a ladrón de un golpe #nmas #shorts
00:17
Маленькая и средняя фанта
00:56
Multi DO Smile Russian
Рет қаралды 4,3 МЛН
I Need Your Help..
00:33
Stokes Twins
Рет қаралды 9 МЛН
Role Based Navigation in React Native with Expo Router
25:41
Simon Grimm
Рет қаралды 7 М.
10 Must-Have React Native Components 😎
10:12
Simon Grimm
Рет қаралды 36 М.
THE React Native Tech Stack for 2024 😎
13:52
Simon Grimm
Рет қаралды 33 М.
Introduction To Expo Router with Stack & Tab Navigator
23:59
Pradip Debnath
Рет қаралды 6 М.
React Native Login with JWT Auth Context
24:59
Simon Grimm
Рет қаралды 45 М.
🔴 React Native Navigation with expo router
22:07
Sujan Anand
Рет қаралды 10 М.
Building Navigation in React Native with Expo Router
1:44:39
notJust․dev
Рет қаралды 67 М.
Обзор игрового компьютера Макса 2в1
23:34
Приехала Большая Коробка от Anker! А Внутри...
20:09
РасПаковка ДваПаковка
Рет қаралды 81 М.
Индуктивность и дроссель.
1:00
Hi Dev! – Электроника
Рет қаралды 1,4 МЛН
wyłącznik
0:50
Panele Fotowoltaiczne
Рет қаралды 14 МЛН