- Podcasts
- CodingCat.dev Podcast
- Code with CodingCat.dev: Expo
Code with CodingCat.dev: Expo
CodingCat.dev Podcast
- June 30, 2024
- 1 h 31 min
- Season 1, episode 2
About this episodehttps://codingcat.dev/podcast/podcast-cwcc-1-expo-react-native
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Code with CodingCat.dev: Expo
Oh, no, no. Oh my gosh, Simon, I just clicked Go Live and I didn't click the keep local recordings. That's a problem. Oh well, let's see if I can edit that real quick. Why is that? Why is that a problem? So the only problem with it is if you or I get a bad connection. I never do. My code won't be as crispy as it should. So this is this is my first time doing this with a, a guest stream as well.
Let's go to a standard view and see. It's going to be a a little a little challenge. OK, It's not fair because I have more subscribers, but but my stream is at 8 people watching. So thanks. Thanks everyone for tuning in today. I'm just hijacking the coding live stream here. I was like, Simon, you'd be good as a test to see if I can like push this out to multiple people.
Oh my welcome everyone. That was actually spontaneous. I didn't expect this. So the stream wasn't scheduled, so Alex just asked me to stream as well. So everyone tuning in from from my welcome. This is going to be fun, but I think Alex can better let us know what this is about today. Simon, do you do a Twitch channel as well? I did in the past, but then I used the software and kind of completely messed up my settings with YouTube and then going live always messed up everything.
So at some point I just said I'm not on Twitch, I'm not a gamer, I'm not doing the casual stuff. Like I finally kind of gave up with attempting to do it through OBS and we went fully over to this format now. So it pushes out everywhere we're on. We're on my linkedincodingcat.gov, YouTube, Twitch, YouTube or Twitch, sorry, and Twitter all at the same time.
Yeah, I couldn't go live instantly. Yeah, that was a little. We'll have to. We'll have to check that a little further. So anyways, since there's so many people joining from Simon's side of the house, what Coding Cat dot Dev is all about, We have two different varieties. We have Coding Cat dot Dev podcast which comes out weekly where we bring in our guest like Simon and we do an interview with them and just kind of chat more on the personal level inside of things and you know, projects that they're working on different things like that.
And then this version is coding cat dot code with coding cat dot dev. And it's a 90 minutes paired programming where basically Simon's going to teach me something that I haven't touched before. Now I will say I will preface this one with we he had to make sure because I'm not a mobile dev, I'm a web dev, but that's pretty cool since we're doing a little React, React Native style stuff, we did make sure that I could run Expo on my machine so.
How long did it take you to set that up? My my little. You you sent me the e-mail and 5 minutes later I was running it. Oh that's awesome. So for everyone interested it really like you. You didn't do any native mobile dev before. I've done like I've messed around. I'll say that like I've had Android Studio on my machine and never used it type of thing. I've, I've gone back and forth a few times on some Flutter apps, so I've written Flutter stuff, but I've never truly written a native application.
I've packaged up. You used to be able to do and maybe you know this, if you can still do this, it's called a trusted web something, trusted web application on Android. So I used to take our coding cat PWA and wrap that and then it became TWA, which you could host on Android and install and everything like that. So.
Oh my yeah. I have so many at at this point I have so mixed feelings about Pwas. Like for a time I thought they were really cool and then I noticed that actually not a single normal person cares about APWA. And then I just like lost interest in it. I'm really kind of curious though, like a lot of the apps like Slack and I don't know you, you can go down a list like they're still kind of build on Electron and spitting out that side of things, right?
So it's it's a wrapper of sorts creating an application. I mean, there's still hope for PWA says Apple is like alone push notifications now and it's better. But the whole installation like experience totally sucks, especially on, on Apple. I think on, on Android, you can at least like defer the installation dialogue.
And then at some point when people use your website, you can say, Hey, we, we also have a mobile app. Would you like to install this? And there's a button and on Apple, it's it's just so awkward on iOS, like even if they have this, you, you can do this and then you have to click share, Scroll down, add to home screen, give it a name, hit save, go back to the home screen, open it.
I wanna show Alex how he can build a React Native application with Expo and I'm I, I honestly have no idea how good Alex is with React and stuff. I agree. I mean, I mean I'm OK I I mean if you have used swells or anything with JavaScript like. I mean, I've written next GS for quite a while, yeah. Then we should be fine.
Then we should be fine. Just never written any React Native, so hopefully, yeah. And I kind of for my audience as web developers, I, I kind of want that experience. Like if you've ridden Telkit or if you've ridden Next JS, you just start getting started and you want to like start into Expo and start creating this thing. This is it.
Like we're going to make this happen for you. Right, so LX did set up his environment before, which means I think you installed Android Studio and like downloaded an SDK. I believe that you even said I didn't need Android Studios. I didn't. I didn't check it much. I basically ran it native app on my Mac. Yeah, so you installed at least Xcode I guess from the. Did you?
I did have Xcode already. Yeah, yeah. And we're using Expo because Expo makes things a lot easier. So for everyone tuning in, if you want to get started with React native, please just use Expo at this point. There are so many upsides and like almost no downsides to using bare react native CLI. Pretty much everyone agrees.
So with the with the Expo, CLILX will now create a new project. So you can run NPX and then create dash, create dash Expo, dash app. Actually you can just hit enter I guess. Yeah. What's your app name? Give it a name. What you have I. Would call it cat app maybe? All right, I like it, Cat. All right, all right.
So this should ask you for. It should ask you something. I did realize I didn't go into my remove directory. I I played the game I think it was two weekends ago where I MP killed like. Oh yeah, that's so. Cool, that feels so good. OK, this is interesting and it's probably wrong, but you can go into there and open up the Visual Studio Code I assume. I assume that this is not the type of app I want to see. Brittany Brittany told me this the other day. I hope it works so I can do code dot and then dash R Oh yeah what?
What is dot R? Oh, this is new to ME-R. Just opens. Opens it directly, so I didn't have to open a new window. And you were using the the command line from Visual Studio Code? Yeah, that's so cool. I know that that was a nice one 'cause I do that all the time. OK, but we need to go back to the command line in a second because this is not the type of app I want you to have so. I broke this earlier by the way.
Please, please ignore this. Oh. Goodness, I hope that's fine. OK so I heard that PNPM you can use like use environment instead of using NVM so I was like trying it out but I messed up my console. Sounds horrible. Yeah. So you have a standard Expo React native application. The only file that does something is the app JS at this point. And yes, you could run that app.
But here's the thing, there's something called Expo Router which gives you file based routing for Expo applications. And I actually want you to have a project with that. You could like. There are 5-6 easy steps how we could migrate this now, but I kind of don't want to screw it up. And usually the NPX dialogue gives you that app. I don't know why it didn't.
So let's just run it with the right flex. You can pretty much, yeah. Press upwards for NPX, create Expo app and then immediately follow that up with a name. So all right, so I'm going to actually go hit enter, I'm going to go in my remove folder. We're going to run that again. Wait, wait, wait. So no, do follow this up with cat app and then dash T and then taps taps all right, that should do it. That should do it.
OK, usually usually you get like a wizard from create Expo app. So I'm a bit confused if they change something and I I hope this is working now. Oh, there's so many comments I I'm not paying attention to. I apologize. I was on the wrong screen. Awesome Simon, we've got a a turquoise waving hi. Can you explain about debugging a react native? How you inspect?
I did a lot of capacitor. Love that team. Hello Hardington, can can you open your folder your cat app? I would love to see if this is now the right type. If not, that would be really, really scary. Oh yeah, good luck, we got it. OK, so without doing any sort of coding, let's get back to your command line in that folder and run NPX Expo because we want to do take the fastest route to get a quick win from our. Project.
Why am I not in the right thing? Hang on. Yeah, your environment might be a bit messed up. So NPX Expo. Just NPX Expo. Yeah, yeah, yeah. So this will spin up your local live reload. You could now actually also install the Expo Go Web on your iOS device. I did. I did this on my my my Android device. There's an Expo like something because I knew it. Scan that code and then you get like the live so. This is This is sweet.
The only problem is that I guess you can't like show your Android screen now on the on the stream. You know, I could, but it might take some time and I'm not gonna, I'm not gonna do that to us. Right so just press I because I, as you can see, will open up your iOS simulator yes alright you know honestly, what would you like just had this feeling of having the app on your phone is like 90% of why I do mobile development. I was so fascinated like eight years ago that I could deploy something to this thing I keep in my pocket all the time. And it just, it just looks as wild as me. Like when do I go back to my wife and show her hey, or I made this Airbnb clone and she's like wow, are you like the master or? Like, like when are you taking over the company? Like what's in dollars?
If it's I forgot we're not in like mobile and I had my browser all set up all right. Nice cool. So all of the stuff takes place in your app folder. Pretty much that's where the where the code of your React Native application lives. And I want to say the previous app we had was a standard React Native app with FGS loading.
Yeah, we got a question on that. So it says he always thought Expo and or sheet. Sorry, I don't know this. Oh, it's Richard, it's Richard Bray. Always thought Expo and reactive or tightly coupled can use one without the other. No, you. I mean you. You. Expo you can write non react native stuff right?
So now we have file based routing and if you check out the app folder, you're going to see a bunch of files in there. So part of that looks really scary and we will soon actually remove everything this. Looks very much like like either Spell Kit or the app version of Next. Yes, now. Yeah, I think yeah, Evan Bacon, who created the Explorer, I think he took some exploration from the Expo. Oh, the next JS route Rd.
OK, so we got live reload. Everything's immediately updated. Wow. Yeah. So native developers would actually kill for that. I'm I'm still fascinated that for like iOS Swift development, they still have this don't have this sort of live reload. You're kidding me. Yeah, they need to redeploy. This must be why like they want flutter so bad in in the other side of the house too.
Probably, Yeah. Yeah, Flutter is interesting. I just did a little research on it this morning. Like it is always super popular in like all the ratings. But if you're like at the job market, React Native totally dominates. Like, no question about it. I'd love for you to become a Google developer expert in Flutter though, so we can hang out more.
We can go to the conferences, I'll do the Firebase side, you do the the Flutter side, we can team up. You know, The funny thing is I wanted to become a Google developer expert for a long time. And at some point I actually had a friend who was a developer expert for Angular and I wanted to become one as well because I did like seven years of Ionic with Angular and I did all the Angular stuff. I'm surprised.
There's no way I could get you hooked up. We'll make that. Happen I I tried to like, I didn't try to convince them. I I felt they might have enough or too many angular GD ES at this point and just wanted to have more. At one point they were kind of shutting it off, but I think it's open again with a whole new Angular resurgence, angular dot dev and all that fun.
I don't know if I could like become a meta meta developer export. I don't know if they have something like that. I think it would be cool though because they would ship you around to conferences for free and we could hang out. Yeah, you know, at that point I was doing mostly Ionic and I felt like becoming a GDE for Flutter was like the wrong sign. Since I'm now doing so much React Native, I could also just become a Flutter GDEI don't know. I just become a web specialist and then like React Native, like there's mobile somewhere in there. I don't know.
All right. So I don't know if we'll get here, but there's a question about protecting routes as well, so. We probably won't get there this far today. You can protect them like at the top level in the layout file I think I have a video on this on on my channel. Holy moly. Why are there like 30-4 people from from?
Stream I know you're popular man. Plus it's night time over there, people love it. Oh, I should stream more often in the evening. Yeah, I never did this dude. You usually hit like. Just come on, once a week on my channel. It'll be good. We'll we'll do this whole thing. That way I can run it all for you.
You. Don't have to worry. OK, so let's do some coding. Let's let's start. We love chatting. OK, let's remove all the files in the app folder. Oh my gosh, are you serious? Yeah, all of them. Like, literally. Yeah, yeah, yeah. It's just all of them, OK, just all of them. And do do a new index dot TSX in there. Holy smokes that felt painful.
Yeah, it was. It was. So I'm, I'm a, I'm a tailwind person. Is this is this tailwind capable? Yes and no. So not out-of-the-box, but there's a package called Native Wind which brings Tailwind to React Native. The person working on this is actually now part of the Expo team. It's complicated, but I think they're working on a new release. OK.
You don't even have like the the shortcuts like the what what what happens if you press RNF? OK, no problem. Real quick. No, Yeah, OK. Yeah, why not? That's. Actually going to be fine. I think this should be like yes, the second one go with the with the do. You want both, yeah. Just do the second one and that yellow one the 4th 1:00. This one, yeah, we should put those in our workspace settings so when people download this after we get done they. They have it.
You're the boss. We'll, we'll. Work on that in a minute. So RNFE and enter. OK, hit save. Sweet. And is it refreshing correctly now? You might have to kill it, like when you remove all the files and do something again. I would just do. I just let. Them do again then. Yeah, just in, just in PXX. OK, How do we do?
Yeah, if you have an open instance on the left side, it's sometimes. OK, that's actually a good point. Oops. What did you do? You can press control command ZI think once you're in the simulator, a little bit of finger gymnastics, right. So this is the cool thing about the Expo go app you get like yeah, some debugging stuff.
I don't. Know what the Sticker Smash is? But. It's. Exciting. Yeah, maybe just do another control command Z and then do reload. It's A. Really hard finger motion I gotta. Tell it is. It is, yeah. So now you see it's loading stuff again. It's really cool, all right. OK, so we got a blank indirect page.
Good. Now this is how we just play a page like. The URL is just slash. If you would put in something like about it will become slash about which is helpful if you do like later. Also for the web Expo, but we want to build out a bit the native app. So what we need is a layout around this. So let's create a under score layout dot TSX in the app folder.
OK, do RNFE and I would write layout now because then it OK, not not you know, if you like immediately do it, then it changes it in all the places. OK, so we won't return a view. We want to return a stack in here. So go ahead with the brackets and stack. And then yes, import from export router and hit save and that should automatically pick up the first index file.
As you can see, we now have a header bar on that page is automatically picked up, which is pretty cool already. You can also know define some some options if you want to. So for example, in the in the stack tech, you can follow up with screen options and within screen options you get like another pair of brackets. And then you can do like header style and then give it some cool.
Yeah, you need to actually do another object. Yeah, yeah, yeah. Do another object and then background color. Yeah, gotcha. And now do whatever. It would be purple man. You might have to put it into quotes. Yeah, yeah. I would put in header tint color next to header style so that needs to be outside.
That that now I save. Yes, nice, nice, nice. OK, let's also change the header of the first screen so we can do some some custom settings for the different screens. So in the stick, do another element. So now it's a bit between the between the stick elements. Oh. Yes, there. And then do stack dot screen. Yeah, it looks interesting.
Stack dot screen, yes. And then give it a name. I never understood these. By the way, I've seen seen the whole LIKE dot syntax. Yeah, I, I think this is like also the first time doing it in, I've seen it here. I don't know why. OK, do name, that is the name of the file. So in our case that would be index. Yeah, actually index.
I know how it works. I I. Like legitimately if anyone ever wants to to let me know, just send me a tweet. We have a a pink hand waving as well. Hello. Hello, Ryan. Hello, where did we leave off? What do we want to change as well? We want to do some some navigation, right? So let's let's display some cats on the screen.
A cats. Array OK cats equals use state. Let's do an Mt array. Just that. And around cats as well. You do the brackets around cats and then you have cats and use a set cats right? Man. Yeah, getting rusty. I've been I've been using signals too long now it's like how does this work? All right, I'll snip it.
All right, let's try it once. Use states. Yeah, that's the one. That's what I'm looking for. Nice you. Do I have that as well? Use state? Yeah, I have it as well. Nice. It's going to be used from that one. Hard to remember when you're out of the flow of things. Let's let's write a error function. Load kits all right, It's going to be an async function. Oops.
Yeah. There's this. Fun. If I don't have to type, we should do this more often like this. Programming. That's the best part of it. All right, let's let's get some data. So let's do cons data equals weight fetch and then do you have to send this to you or? Async. Do you have like a, like a, oh, we have a private jet.
Constata equals fetch. Do we have types in here for TypeScript? Oh, I I added them. I was cool like I was. I was the cool kid. You can. Do I need to do an interface somewhere? Yeah, there we go. I gave it to you. You. Just want at the top of. This, Yeah, just edit at the top. I mean, theoretically you could set it at a different file, but yeah, whatever.
Button from React Native and title. I don't know load kits in the button load. Or. Yeah, on the on no, you actually have to use title equals load kits. Oh, Oh yeah, yeah, I mean they're different, different types. And on press you want to call load kits is. That like one of. These you can, yeah. Yeah, either like that or just load kits without the error on would be shorter if you just did load kits. All right, so we're able to load the kits, now we just need to display them.
I'm a big fan of like backgrounds on my button. Is is there a capability to do that? This is using like the completely native iOS button. You can change I mean, yeah, you can change the color. Let's do some some styling there. So let's. Style. Should be. Oh, the button is actually pretty worth dialing, so usually you use like a touchable opacity. We don't have to do this, that's fine. We keep that one.
We keep that one. OK, OK, so below the button, let's do brackets so we can do Ket's map in that six the the what is it? Curly brackets? Are they cool? Are those curly brackets? I call them curly braces. Braces. People keep telling me there's something like, guys, I just did a a video short on this. Brittany said something hilarious and apparently it's a thing.
It's like some curly guy or something. I don't know. Anyways, all right, so cats. Cats dot map. Oh yeah, we have to do the whole map thing and react. I forgot. Oh yes, yes, yes. Then we got a cat. There like an index and a key and stuff. Yeah, but Cat is enough for us today. Good. And then you can do round round do the round one because we have an object.
I guess not. Just add it OK and we need to set the source. So really the source set this like right source. Oh. Yeah, yeah. Not SRC right source and then equals and then 22 pairs of brackets and then Yuri and then we can. Is it cat Uri or is it just? Yeah, it's cat dot URL, but we need to do it in another pair of brackets here again like an object and then Yuri.
Exactly. Yeah, OK. And it won't display your cat by now, so you still have to give it the style. So let's just set the style and then an object in there again with 100%. OK, so in as a string 100% and like hate 300 and then we should finally see something. Yeah, height, height. OK, I said hate, right? Yeah, I was like, why do you hate it? I don't.
Know. Oh my. Oh. That's funny. Let's do the the 300 just as a number. OK, OK, I can put picks. OK, let's try load kids do it. Boom, you shallow. Let's see, it's already all about the key thing. Yeah, yeah, yeah, we're going to do this in a second. So the problem is we can't scroll this right now anyway. So you've already made an empty fragment around the image. Oh no, that won't work around the cuts. Map a cat's map, do a scroll view, Let's do a scroll view. Scroll view.
So let's print out the cats you get there, or console lock the cats, not print. We're not in flatland and go to the to command line where you run the NPX Expo command and press J OK, yeah, well, well, that is the ID problem. What? What is this? So the cool thing is we now have the dev tools in here.
I'm like, what's happening right now? I'm impressed that worked at all, all right. All right, all right, all right. Hey good work on the cats API by the way. Thanks. OK, good. Let's put some. Thank you, Caesar. Yes, thank you, Caesar. Let's put a bit of styling on this. I'm going to take our. I'll log back out for now.
Yeah, right. So that is the the cool way of easy debugging. Like it's just the browser tools at this point and expo's working with more stuff so you can also debug networks, network calls. Like. You see, it's just the the Chrome Dev tools, so that's pretty cool. OK, we want to. Yeah, exactly. So that's cool.
I don't know why sometimes it's not picking up like on the first try and then reload showing up the network inspector or something. I wouldn't say it's perfect. I think it loses sometimes the connection like it's an open back or something. But fair enough, still gets better. OK, so the idea is we'll want to go to a details page now, like the classic list details pattern. Of course, that is the brand idea. That means we do need another file in that app folder. OK, let's call that file is it?
And call it like it is actually like call it page or something. It doesn't matter. Just make sure the no, just call it page or the Yeah, it's just that you export at the bottom the right thing. OK, let's do for debugging. Let's try to grab the ID immediately here on that page. I always want to like I always click in this window and try to write it. OK, So when when the page not in the return above the return statement we're going to do construction ID. Oops.
Sorry, yeah, there that level construction and then in in curly braces, put the ID in curly braces. So we can like just structure the object equals and then use local search params. OK, so this is using the export router. And with the export router, we're going to just basically put the ID of the cat in the URL when we route. And here we're extracting it.
So you can like do a lock of the ID or you can just yeah, just replace the ID in the in the view, in the text elements. So we're printing it out. Just do this. Yeah, Yeah, exactly. Yeah. OK, cool. OK, let's get back to the index page. And we need a way to get to that page, so let's instead of having an empty fragment, let's use the link component. That's pretty much like the next JS link. I think it's heavily inspired by that. So press Enter.
I don't know what the. I did shouldn't make a difference. And then H ref, H ref. And now if you put like start the what if you if you start quotes, what happens? Yes. OK, you get only slash. OK, normally we get like code completion here, but then yeah, not a big problem. So what we need is cat ID in here.
So let's do slash. Maybe let's do. I don't know if you use string literals or. Whatever. Let's do that. Let's do, yeah. Cat ID put a slash in front of this because there we go Yeah, that could eventually work. Oh no, you need to put in after the H ref put in South child because if you've wrapped the link component around other components S child. Sorry, sorry, I'm in the wrong spot. There we go.
All right, not working. Yeah, we think we need around the image still something that we can touch. So put around the image a touchable highlight which. Is basically like outside of link or. In inside of the link, inside of the link, yeah, which is like yeah, an invisible thing that we can touch and do it around the image. OK, is.
That was interesting. But but but the stream was like continuing right? I I have my open, my stream open and I just like. That was really interesting since we're taking just a quick pause here with what I thought was my Internet and it wasn't. I still have a gig up and down. I'm going to grab a a soda and I'll be just right back.
That was so cool. I just told everyone that I did a workshop last week, 5 hour zoom workshop. And there were actually like I, I timed it for, for Europe time because you know, I'm, I'm just best in like my time. So it was like 9:00 AM to 2:00 PM European time and there were actually two people, one from Los Angeles, 9 hours behind and another one well, six hours behind.
So the workshop started at midnight for the guy from Los Angeles and at 3:00 AM for that person. I'm like, holy moly, you must be really dedicated to learn if you get up at 3:00 AM. That's really intense for sure. Oh, it was, yeah. But I had a. Move like I was doing mine at like my 5:00 PM and we're six hours off so 5 eastern and at at some point I all I realized like all the svelt people and I do a ton of svelt stuff they're all in Europe so I'm like I'm gonna do all of these at noon my time so it actually works out so all right all right back to the code
so. OK, we we we, we have the the basic of a stick navigation here in place. The cool thing, which you probably didn't even notice, is that you just edit a file for the ID page and like we link to that page and that was all we needed to navigate because the Expo router was actually picking up that file automatically.
We don't even have like an entry in our layout file for it. So this is like file based routing, right? Exactly. It's. Beautiful. And you could now actually you would press W in the in the Expo command line. If you press W, it would actually open up your browser and would spin up the preview. And like, we haven't optimized it for the web of course, but theoretically you could use it and it would work just the same thing.
So this is in my mind. This is very flutter esque but React and I know how to write React so that's cool. Yeah, I mean, it's not completely like React because you use like a view and a text and stuff. Right. I feel like there there were some React component libraries though that are very similar to this. The only difference being like the kind of the rendering and the NAV, those components that gets a little interesting. So, but yeah, I can.
I can totally blend it. OK, where do we continue? Let's put in some styling in the index page. Let's add a bit of padding and and like stuff around them so you can below the the page. So before the export default, you can do like con styles equals style sheet. So uppercase style sheet. Exactly this from React native dot create Yeah, it didn't pick up the right import, but yeah, you're right, never does. Cesar Merlot, New member.
New member. Wow, you gotta follow. My Stace. Oh yeah, I think Cesar just yeah, nice. Cesar, go follow me too. I need. People, thank you, Thank you. OK, so curly braces again in the crate, we're going to do a little object. So this is how we can style our stuff. So it's not just exactly CSS, but it's close. So let's call this I don't know item, and then we do some styles for the item.
Are we doing like classes or no? Is it just like? Just doing it on? Yeah, just do item. What is it called? Are you looking for like a colon? Colon yeah that was the name and then the object let's just do like margin 10 yeah that's why I. Was wondering what you're looking for Margin. I assume it's 10 pits, but maybe it's just 10. Yeah, it's just the number 10.
And then let's give this to the the touchable highlight. Let's give it to the touchable highlight. So there we can say styles and then equals and then object and styles dot. And then we got the name of our yes. It's style or styles. Yeah, it's style. I always mess that one up. Oh yeah, there's our margin. There it is.
So it's doing margins between each image and we need to probably do an overall on the scroll. View for a padding we can. Do they do they have the do they words, Alex? Do they have? Grid or flexbox? Flexbox. Yeah, we we like everything is flex. OK, cool. But I thought I would like work this way, Austria and Vienna. So I was over there not that long ago. Beautiful country.
Oh yeah, Vienna. Vienna's a beautiful place. I was again in Paris two weeks ago. I love Paris. Paris is beautiful as well. Have you been there? I have not been to Paris. My most close friends will be there at the end of next month though and I warned them. So I guess technically I bounced into Paris, but I warned them about the What's the airport that starts with AC Ed? Charles de Goe.
Yeah, Charles de Goe, is that it? Terrible airport, really. I every time I have to go through there, I am basically late for a flight and it's always like an inbound and like I get stuck in security and I got to take 12 buses to get out to a airplane. Like it's horrible. I hate. It the good thing is there's a train.
So Europe is pretty good with trains you might know. And we from Germany, from Cologne to Paris, there's actually train which drives through Brussels and like Liege, something like two stops or something. It's three hours from Cologne to Paris and you arrive like directly in Paris, like Dunard is in, like we have a 10, a 10 minute Uber to our home than we were there so.
Man, you've got all kinds of international people. Simon, look at this. Morocco. I forgot. Holy smokes. Yeah, yeah, I have an. Android. I'm not sure on that one. Eight, is it DB? I think you mean Deutsche Ban, which is the the German train company. No, actually it was the Tallis and it was now the Eurostar which is also going to London.
So Eurostar is like, yeah, or really bought them? Yeah, Charles de Gaulle, thank you. De Gaul de Gaulle, we have a question out here we should probably answer problem fetching in Android. Is there like a network setting? You might have problems if you're not fetching from Https://in that case you have to enable something for Android like allow clear text traffic or something. That might be the case.
I would just probably go with the Expo debugger and see why it's not working. How's the goal? Yeah, I'm, I'm sorry. I'm, I'm, I'm sorry for my French pronunciation. I never learned French. It's. One semester and all I did was make pottery. So it was a French slash art teacher that taught French and she's like, I don't care if you learn French. I was like, thank you.
Yeah, I I learned the more important language. I learned Latin in school. Yes, very important, very useful. Yeah, you know, it's actually quite interesting. Like you can read the old stuff in churches and and stuff and know where some words are coming from, but. Yeah, of course. Nobody's speaking. It did.
You take English in school. Yeah, we like in Germany, we have it from starting like fifth grade or something. We everyone has to get English, English. I think it's now even starting in like earlier. Good. Call. It might be coarse. Yeah, so my wife had to go. Into every shop and order this stuff because I was like the the problem is in in French, they don't really like English.
So in Paris it's OK, but we were in some in one restaurant and we wanted to know. When they open and the the. Waiter was just answering in in French like G snuff. When do you G snuff? I mean my wife knew there was like 19 PM but just say like just say 7:00 PM. Like everyone should know that at least the numbers from 1:00 to 10:00. I'm sorry.
I knew that one. That was it. I was like 10-9, Huh? Yeah, yeah. OK. OK, we got a. Touchable highlight. We got a image we can route. It gave you a little a little styling. Oh, sorry. Yeah, you can. You can place. This in the Yeah, yeah, private you can. Put this in the item so we have the bit of shadows and a bit of margin and a bit of offset and everything should just look, yeah, like some cards, right?
Oh yeah, that looks real. Nice. Still this this thing down there, I don't like that. Yeah, if you want to, you can go into the scroll. View and then it's the. Was it? What's it the? Content. Container style. Oh sorry, in the in the scroll view element? Yeah, as the content container style. Then you can give it like some margin at the bottom or something.
Although it feels a bit wrong to me. We can also like do we have time to refector this or do I this is this is? Your show, man, You're telling me we've got just a time? Check we have. 36 minutes to get whatever you want done. We can refector it later. Let's let's. Let's go, let's complete the the ID page. So let's on that page just use the data we got from the URL just so we have a complete picture. I will give you that function again so you don't have to do the function.
React. OK, yeah. And then we need a stage, so. Let's do an constant image and set image when we learn use state. Oh, yeah, yeah, yeah, yeah, yeah. Look. At that oh so you're good. You're immediately putting something you learned into action. Oh I'll it's not like it will help out immediately, like 2 minutes after.
We shut down. I'll be like, what was that thing? What's? This image image image set image. Yeah. So sorry, image set. I don't like that it doesn't camel case these automatically for us, but that's for another day. Do we do this? Yeah, I would. Just nothing. Yeah, should be fine. Yeah, I mean it works. If it works, it works.
Oh love it. And then we call load cats. This has to be empty, right? You don't need to return anything. Right now it's true. I'm used to Firebase. I gotta like. Cancel the listeners and Oh yeah. Oh my, this. Is so great that Cedric is. Joining us, So Cedric is the entertainer. Cedric the Entertainer. Oh, Van Putin, right?
He's working for Expo. So he just clarified something about Metro and Beibel. He's probably, yeah, could probably. Describe it a lot better than I could an older other. I don't I don't know some of these words. What is Hermes? Hermes doesn't support. Wow, I feel like I'm in Percy Jackson right now. Right with Hermes and Cedric.
Thank you. For that I'm. Always amazed by people's like, knowledge that they just have readily available. It's what was my mind. Yeah, Metro is. Babel Bell doesn't know. Metro, I mean, that's, that's the same. When I, when I, when I look. At that's probably what. You left now I was behind him. Sir, when I looked the primogen.
Oh, we still got that warning. Let's put the key from image on the link component inside that iteration. Yes, it's. It's very angry with us. Yeah, it's looking ugly. Yeah, now everyone's happy, huh? Yes. OK, Our last cat looked a lot like mine. I. Miss it? Oh well, all right. Yeah, we were on the on the. Details page right?
So let's just let's just show the the image there. You can do something like let's remove the line with the text. Can I copy this? Sure, sure. OK. I would do a little if in there. OK, So like if you. Do have an? Image or if you not have an image. OK, I forget, is it just? Open and then yeah, yeah, if image you can do image and. End.
So that's the short. Form just to know. Without the if you can just write image. Wait a minute, what are we talking? About like, yeah. Yeah, yeah, yeah, yeah. Just write. Image and end, so the end sign gotcha and and is it the ampersand, right? Yeah. And then you put put the image stuff in there and then the round.
View. The view can. The view can. Yes, yes. And then it should be image. Not cat. Dot URL. All right, who Isles? Do we need no unhandled? Promise rejection. Did we? Yeah, we. You. You have the copy again. You copy. The every time. What's wrong with me? Images images slash and then ID and then the curly braces idid Yes, yes, thank you.
This stream is becoming too French. All right, Where did I get lost to? Let's see and. This thing, that thing, this one like that. So now we do also have a little loading. Indicator we probably don't see it for too long but kind of heard that kind of looks a bit scary to be honest so my son. This is called something chromatic by chromatic, I don't remember.
It's also an X-Men and he thought it was. It's like heterochromatic. I don't know when you have two different colored eyes like that. He has a brown eye and then like 3/4 brown with a blue like patch in it. It's wild. Crazy. That's wild. We can look at a different one though. This looks also but. Let's go to the layout file because it still has the header with like ID.
It looks ugly. So go into the under score layout file again and put in an entry. Just copy that one from the index I mean. That that line. So go to the layout file or copy that stack dot screen line. Gotcha just. Yeah, you could put. It in the layout file. In the layout file. Oh, you can put it in the layout file. Yeah.
So we're basically defining the. Information for the routes. So that second one will be really like ideal. Yes, I I didn't realize you needed. These like when you had file based routing I didn't think you don't need to so it works right now. But if you want to change for example the header like on that page I want to have title blank. Do I do like that?
Yeah, Interesting. So. That's. Kind of the same as capacitor or not capacitor. What's the, what's the layer? I don't know. I'm just gonna pretend I didn't read that 'cause it'll hurt my head, all right? So we're. On our details page, we have a cool heading. Now what's next we're going to venture off into? Some fun more so I wanted to also display a modal page and eventually open the camera just to have like a little, we did a bit of routing, we did a bit of loading with a few elements. So let's try to display a modal.
Know I tried that way for a long time and did you know you can do like multiple? So if I wanted to go folder in folder index dot TS, Yeah, that's pretty. Cool, That's love that. All right. The model has. To be TSX. OK, that's what I was gonna ask. Yeah, I burned myself. Many. Times on that as well, like why is everything red? Is it it's all correct in here.
Are we are you in Fe? Yes. Let's do this one again. Yeah, we don't have to display anything yet. We just need to show it somewhere. So let's go to the layout. We'll just add a. We'll just add a button to the index screen. Yeah, but we. Can do it from the layout because in. A layout we can like we are affecting the header bar stuff.
So that colon. And the one with the. Thing is, semi colon, yeah, and I always have to think of semi colon before I can remember colon. I don't know why Fry 'cause I like driving. Semi OK. The interesting thing is, yeah. Semi colon in German is semi colon. Oh, that works the same, but the other one is.
In Germany you can basically stick every word. Together like there's one though that's like 40. 40 words put together and it's a thing. I'm like OK sure. Or or by dump Chefarts gazelle shafts. Capitan probably that's like, I don't know, it's something we say sometimes, but all right, we're we throwing in here a component. Yeah, we're we're flowing in a.
Functional like the the round brackets and then the error function and then we do a link component in there. Because we use the link component from Expo router again then it's just easier You can you can you can also press command BI do it all the time, which closes the yeah yeah thank you I love that yeah we got it from Expo router HH ref is going to be yeah, we need an H ref on there all good all good all good. It's weird.
It like, no, no, yeah. Oh yeah. It's. Oh, it did a new line. OK, that drives me crazy. Yeah, let's do an H. Ref. And then? Quotes and now you see it's. Actually picking up the stuff. It's even picking up folder and that's a cool thing about. Like statically? Typing these routes with Expo router that you actually know what routes you have.
They come right with it, Yeah. Let's use name. I don't know, whatever, whatever you prefer, name, camera, dash, outline or something. OK, is there a up? Is there? Like an up something I don't know up or up does it camera? Hurt. You. Gotta give it the. Size and the color. So give it like a size of 28 and the color white, yeah. Ah, you're getting really fast.
Well, React Native, huh? I I wrote a lot of react. For a minute and then stopped and went to spelt right or. Wrong. OK, so you click. It you see, you guys still got the. Push effect. And we actually wanted to get a modal effect. So we can now define this in the layout. Oh, we are in the layout, that's good. So for the modal, where's the do we have an entry for the modal yet?
Start with yeah, this. No, it was right. It was. Yeah. So there are a lot of options for the presentation. We will go with the modal for now because I think modal is pretty cool. Modal For the modal, yes, hit save. And then click it again. Success. Quick question. Out here it looks like. Something about tears moving screens. OK, not that Are we using V3 for Expo router? We're using V2 right now.
Expo router V3 is in beta right now. We could have used this, but I didn't want to put this on on Alex today, so I was afraid it's I think yeah, we got Cedric in here. Maybe Cedric can can let us know when Exporato V3 becomes stable. As far as I know it will become stable with Expo SDK 50 which should come out in like January or something. We can talk maybe in the end take like 5 minutes talking about you want to, you want to come on. Simon can DM you the stream yard link. Can I?
You would have to use some sort of community package. I don't not that I know that you can like defer that, OK. I'm just curious to like. Hold I I know. Like. Mobile app devs. Aren't as concerned about see Cedric wanted to join see how quick that was look at that hey Cedric hey all this is becoming.
An international stream, right? Surprise guest. Yes, Cedric, we want to ask some questions probably about Explorato V3 in a second. I just want to wrap this up with Alex in terms of the coding. So bear with us. It just look beautiful down there, so OK. I. Wanted to what did I wanted you OK, I wanted you to show the camera so do you yes you do where's my script I actually prepared a script with the installation command for you OK so you probably can do this yourself you can go here I will send you a link because then we can also show how it's integrated so we're going to use the Expo image picker because when you use the simulator it's.
Always hard to demo. The camera because there's no camera, so I like to just use the image picker so we can select an image. There's an installation command that you can now run which is NPX Expo. Install exactly image picker and usually you have to do. Like native? Permission stuff if you want to access images, contacts, GPS in the mobile app.
But since we're using the Expo Go app, we don't really have to touch that stuff like the Expo Go app is already automatically requesting those permissions. Usually you would put in this config plug in that. I don't think I want to explain config plug insurance in 90 minutes beginner stream right now. That's fair.
OK. So you have it. Installed right? Yep, let's just take that block, like there's a block, you see that in the cons pic image. Let's just use that one. I think I actually just copy that page. Just copy it just to whole thing. Yeah, there's a button to copy. OK. And just put. It in the modal page enormous now.
Your fancy. Oh, you remember it? Nice. Yeah, it's. I had to use two hands. Still, but I think. You. No, you can't. Really do it more OK, pick an image, pick an image. I like this. Pick the one that works nice and we got it OK. So it wasn't as impressive as we just copied the whole code for the modal page.
But still, if we look at the code, it's quite short for triggering a native functionality and it just works the same on Android. An image trigger OK. That's just coming from. Is this a community package? It is an Expo package. Oh, it's an. Actually Expo Oh, is it a wrap around a commute Expo image picker? Yeah, it's.
In in your official, I think that's an Expo. It's an it's a special Expo package. Nice, cool. Cool. So. We've done a couple of cool things by now. I really dig this. I mean for for a web. Developer like myself and like the people that you know, didn't show up today 'cause we're full of all your people. For our people.
I think this is a really neat way to show off how to move towards native when, you know, react. This is cool and we have a. Great question from. Olivar, which you can maybe put into the. Yeah, let's go, let's go. This. Way. Throw it in for an app that is. Both mobile and web compatible. Do you feel I can confidently go Expo router as my main router for web and native?
Or should I use Expo router and like React Dom in conjunction so there are? Basically. 22 options, Oliver said the one is Expo router and use it for the web, which in general should. Work I've I've done. It as well in my workshop like you can have different layout files than for the web. You can have different platform specific files. You can even use CSS for the web with Expo router in in those files.
So technically, there's nothing really holding you back effectively. I've talked to many people and usually the answer is I still prefer Expo in the Mono repository next to a Next JS application and then use something like that's called Solito, which like unifies routing. It's basically a wrapper around the Next link and the Expo link component.
So if you then use the Solito link, it will, based on which platform you run, use the right link. But yeah, I, I think it depends on on the scope of your project. Like if your web project is really advanced stuff, then yeah, maybe just use next JS because it has like all this, the cool features and functionality.
Maybe maybe that's a good point for Expo for Expo for for Cedric to to say something about this. This is just like my opinion, but you have seen probably other bigger projects as well. What what's like? What are people doing? Yeah, so. Thanks for thanks for inviting me on a quick notice. But so basically like the way we are trying to build out expert router is that it's with the same ideology in mind that Expo has with free or like really native in general has for pretty much anything where you can always drop down to the native layer, whether that be iOS or Android or even WEP. Like we consider WEP to be a native layer in that sense. Unfortunately like it if you compare Expo router to next yes, remix, yes, Astro or svelte, it's simply not yet feature complete, meaning that things like data fetching we we don't really have a great story around that yet. So I fully.
Understand that. You're saying like we we want to, we want to have a mono repo where we have like up to date modern web tooling besides up to date modern native tooling like Expo. But I'm pretty confident that like if we finally catch up. With all the. Concepts that have now been rolled out to pretty much any big web framework it. Might actually.
Make more sense to stay within Xperouter as you already said, like you can add a platform native override or file extension like dot Android dot iOS dot web. And from there you can pretty much do whatever that platform supports, right? So on web you can add diffs, you can use spawn, you can use whatever web library that works with React works. You can use it however you want.
So I agree with it right now, but expert router isn't done yet and we're still going through. Great answer, I will put on some. Some glasses. I have a question for both of you. I will not put it in the chat, I will just directly ask are these glasses that seem to block blue light actually work like that's that's the main. Reason I wear my.
Glasses I really. Don't have much of A like a there's, there's not much in these. There's just a slight little tiny bit. But mostly it's the blue block and I think it does. I think it makes a huge difference. I I wore them in the evening. I'm. I'm the Huberman fan and I don't know, I want to don't want to hurt my eyes in the evening and stuff so I have no idea if this actually makes my sleep better. Did you just say a Huberman fan?
It's just epic. Like, isn't he? Isn't he? He's at least in the top ten podcasts, as far as I know. Yeah, my spelling. They're like, how do you spell? This is it with the H. HUB Yuba man Yuba man Lab podcast should be it so oh. I know the face. Yeah, yeah, yeah. OK, I got it now. Yeah I have not listened to this but someone suggested this to me the other day.
OK. I thinks, OK, what what question do we have when I create APK size is too big, how can we compress Expo? I think Cedric answered this one. Cedric is really like we're a good team. We two keep chatting and Cedric is just answering the questions. I know that I'm supposed. To be this, this person. Doing these things but the answering questions maybe this is what I need to do.
I need to schedule two people like one to code one to answer questions all the time. Did we get this angular one? I'm coming from angular. This is my first react projects. Trying to get my head around how to do structure project I mean. This is like. I find so I was I was huge Angular guy too, but I find file based routing and like the routers and reacts so much simpler than Angular.
Even though like with the new Angular, you can kind of specify certain pieces of it. So in the like router file it it gets a little simple. But with file based like it's so easy. You don't even have to mess with it. Like from what I saw, Simon, you can correct me, but when we were just adding those titles, if we didn't even include those, like, it would just work without that.
So you don't even have to worry about adding a routes file. Yeah, yeah, yeah, yeah, right. I mean we defined. The native stack layout in the layout file, but we didn't include a stack screen for the details page or something and you could still use it. It's just like to add additional information to that page. So it's making the process a lot easier. I mean, The thing is you haven't seen the other side. Like you haven't seen what people use before React navigation.
And if you use React navigation with TypeScript, we would probably have spent like 30 minutes explaining types and like union types and and setting that stuff up. Did you just kick Cedric or did he? I don't, I didn't click anything. I hope not. Oh my, did you want to go off screen, Cedric? Sorry, no, I I was I was thinking since you. Guys are, since you're all talking like maybe it's a bit distracting that I'm there as well. No, I, I I just wanted to make the transition to. You.
So maybe Cedric, you can explain when Expo Router version three is coming and when Expo SDK 50 is coming and like what's the, the main difference to V2? Yes. So like right now we're working on the SDK 50. It's currently also in beta, beta, however you pronounce it. And since we are going into the holiday season, we extended the, the period of the beta phase all the way until somewhere in January, I think it was early January, but don't don't hold me to that. So that also means that Expo router fee three will definitely not get out of beta before that either. So I would, I would say expect it around January somewhere next year and.
What are the cool the cool? Things in Explorato. Version 3. For that I need to take a. Quick peek, but there are so many things that we. OK, while you look it up, I will tell my. Favorite My favorite is 100% API routes since Evan announced this like the concept. I mean, Alex, you know you've used Sweltkit, right? So in Sweltkit API route just put plus something next to the files and you have the API route and exactly that is coming to Expo router, which sounds crazy because we have a mobile app and we don't really have like API route. So it's like a bit more complicated later to deploy this and it, I think it's kind of confusing people because people like, oh, so my native app has API rods and I'm like, yeah, no, not exactly like that.
So. The web version of that would though, right? I mean you. Just. Need to deploy. Them when you run the live reload, it actually works perfectly fine next to it. But if you have your native app, you need to deploy the cloud function somewhere else in a note environment so they don't magically work.
They're not bundled with the native app. You still have to like deploy them somewhere. So I think that's what's confusing people a bit. What's What's a typical deployment for? Expo, where do you put it like Versal or something? Yeah, so. Expo router can. Export like we we can build it to anything that supports either, like things like Express.
I believe we have a Netlify prototype and maybe also a Versal 1. I think it already works with like minor with minor effort, but we haven't documented that variable yet I believe. But yeah, it can basic like it's basically just a node JS server, right? We use the new up to So it's pretty much like winter CG compliant. But yeah, you still have to upload it somewhere. That's really cool and.
I think it's. Just it's just so cool because. I mean you have the the same code. In the in the that. Project, I mean, that's cool about next JS as well is you have the API routes and like the regular pages, but then having it for Expo and React Native project. I think this is yeah, I'm I'm curious to see where where people will take this.
I'm I'm certainly going to like use it a lot and enjoy the the ease of having it in one project. Nice. I think we're. We're about running up on it. Any last thoughts around Expo that we might have missed at all in the? Meantime, I'm going to show this uberman. Lab screen too, yeah. Then I'll show you how to get to the coding cat dot dev. Podcast so you can listen to us later, I mean here. Sure.
I mean, I don't, I'm, I'm not affiliated. With Expo, the company or anything, but we haven't touched on their EAS build services. So the Expo application services, which allow you to basically build your application in the cloud, to put it easy, so you can connect it to your repository or push the code, and Expo can build your iOS app.
They can build your Android app. And then you can either download those stuff directly to your devices, or you can even like have a pipeline set up so it submits it to the iOS App Store and Google Play Store and they handle everything. Yeah, that's such a pain. Yeah, I know a lot of companies using this. So this is I think you get a few builds for free. I don't know the numbers Cedric.
How much do I get for free? I believe 30 builds and. Then after that you will get put in a queue where you share the resources with everybody else, so you have a couple. Of priority think. Priority builds to just to try out. See if it it's worth for you. And if I mean, if it is, but you still don't want to pay, you just have to wait a bit longer until the queue, until it's your turn in the queue. That's cool.
That's really good. So yeah. Expo's just. Yeah. To to wrap it up, probably we can say that Expo's just making React Native development a lot easier as you have seen, like you created that project, you used Expo Go, you deployed it, it just all worked really seamlessly. And to everyone, like there are a few people saying, oh, but the Rick native Bears CLI gives me more freedom.
I talked with with Cedric about this before and on the stream, it's Expo has something called prebuilt now, which basically creates an iOS and Android folder. So you pretty much you're basically going freestyle then and it's really easy and you like still get the live reload and everything. So there's not really a reason to not use Expo at this point. Nice.
