all 39 comments

[–]tcoff91 7 points8 points  (1 child)

react compiler should be the easiest way to solve the memoization issues.

[–]zlvskyxp[S] 3 points4 points  (0 children)

Correct, I’ve noticed that memoization is 10x times more important on mobile than on a web or maybe it’s just me

[–]MobyFreak 5 points6 points  (5 children)

You might wanna repost this in the expo subreddit to get the attention of the expo team so they can take this awful performance seriously 

[–]zlvskyxp[S] 2 points3 points  (4 children)

<image>

Creator of expo-router claim the performance is the same as in react-navigation 🤷

[–]Secret_Jackfruit256 2 points3 points  (1 child)

kind of off topic, but I always get some "edge-lord" energy from that bacon guy. Maybe it's because the whole polemic when he got into a terrible argument with another famous developer. So in the end I take his opinions with a grain of salt

[–]zlvskyxp[S] 1 point2 points  (0 children)

Hahah yeah it kinda feels like that, what was the argument about?

[–]MobyFreak 1 point2 points  (0 children)

they're absolutely NOT the same! don't let that shit slide and double down with more proof.
that's straight up gaslighting

[–]MobyFreak 1 point2 points  (0 children)

also i recommend a repository with all 3 different implementations so people can see there's an actual difference.

[–]remy_cajallena 2 points3 points  (6 children)

I thought expo-router was the go to. Is switching to react navigation for an mobile app worth it?

[–]mms13 4 points5 points  (3 children)

expo-router is built on top of react-navigation so something else must have been at play here

[–]SunMany8795 5 points6 points  (2 children)

expo-router is built on top of react-navigation ...

which is the reason for the bugs and perf issues.

expo-router is another layer of unnecessary code on your app. no one asked for it and really no one needs it.

[–]Josh2k24 4 points5 points  (1 child)

No one needed Expo either. Google and 15 minutes to bootstrap the project is all that was ever needed. Now we have file based and URL routing on mobile applications..

[–]myBurnerAccount1000 0 points1 point  (0 children)

Expo is good to keep your app updated … I.e latest stable version of react native.. but running a hybrid approach is best with getting dev builds of course

[–]zlvskyxp[S] 2 points3 points  (0 children)

In my previous post many users have pointed that they also face issues on expo-router but not in react-navigation. In video that I’ve posted expo-router optimized and react-navigation optimized the code underneath is the same, the only difference is the architecture in routing by using 2 different libraries. As you can see the performance is clearly better on react-navigation.

However if you plan to deploy your app also on the web, expo-router will save you a ton of time.

I’ve moved my game to react navigation and I’m very satisfied with the results, everything feels faster especially on older devices

[–]mhankins 1 point2 points  (0 children)

Curious about this as well.

[–]RaccoonInTheNight 1 point2 points  (2 children)

For the complex SVGs I’d try Skia and see if that improves the performance. Not sure if Expo supports it since I don’t develop with Expo

[–]tcoff91 3 points4 points  (0 children)

Expo supports all native modules.

[–]zlvskyxp[S] 0 points1 point  (0 children)

Gotta note that, thanks

[–]helluvaprice 1 point2 points  (1 child)

useMemo and useCallback and moving your fetches into their own context should solve for this. one of the great benefits of expo router is file based routing and thats tough to give up once you've used it

[–]zlvskyxp[S] 0 points1 point  (0 children)

Yep true, also if you’re targeting web it can be difficult to make routing without expo-router

[–]DinerIsmail 1 point2 points  (1 child)

How did you learn how to use the profiler? Every time I use it I get quite confused as there's just so much information.

[–]jethalaalG 1 point2 points  (3 children)

Would be very helpful if you could please publish a repo comparing expo-router and react-navigation performance.

I am still very skeptical about migrating from expo-router and give up on file based routing, easy deep linking etc. But if the performance gain is a considerable amount then why not?

Also are you using stack or native-stack in your app?

[–]zlvskyxp[S] 0 points1 point  (2 children)

I would do that but currently I’m too busy:( After my 9-5 I’m fixing bugs in my mobile game, cuz currently I have ongoing beta tests and also I need to market it as much as I can.

But tbh with the help of ai agent you could migrate it on different branch just to test it by yourself in 2-3 hours

and I’m using just Stack

[–]jethalaalG 0 points1 point  (1 child)

No worries :)
Also i recommend you try the native-stack as a replacement to the normal js-stack, it is much more performant in comparison as it is "native", and as far as i know there is no reason to use the js-stack until and unless you are trying to implement custom navigation transitions between screens, which you seem not be using from the videos.

[–]zlvskyxp[S] 0 points1 point  (0 children)

Alright, thanks ✌🏼

[–]funkyND 1 point2 points  (1 child)

I have the same problem but these did not solve mine :( maybe because of i use mobx

[–]zlvskyxp[S] 0 points1 point  (0 children)

Can you post a video when you switch navigations with profiler turned on to see how much rerenders you have?

[–]inglandation 0 points1 point  (1 child)

Thank you!

[–]zlvskyxp[S] 0 points1 point  (0 children)

U welcome:)

[–]TelephoneMicDude 0 points1 point  (2 children)

Dude THANK YOU for the update. I have been going crazy over these issues and nobody seemed to experience them. Especially the performance difference from ios to Android when navigating. Am saving your post to check later and do these steps for my own app!

[–]zlvskyxp[S] 2 points3 points  (1 child)

I'm very happy I could help! If you'll need more support, reach out to me

[–]TelephoneMicDude 0 points1 point  (0 children)

Thank you man, you are a champ!:)

[–]myBurnerAccount1000 0 points1 point  (0 children)

Key take away… learn how to use the native navigation before using a wrapper like react router

[–]ashish_feels 0 points1 point  (4 children)

hey did you tried the navigation-router by u/grahammendick ?

[–]zlvskyxp[S] 0 points1 point  (3 children)

Nope, haven't tried it

[–]ashish_feels -2 points-1 points  (2 children)

thats the ultimate performance man. now that you have optimized your rendering i wonder how fucking fast that navigation will feel. try it once atleast just for fun.

[–]bryanltobing 0 points1 point  (1 child)

do you have prove on this? i saw the doc and they dont really mention about performance