Check out a free preview of the full Intermediate React Native course:
The "Scalability Q&A" Lesson is part of the full, Intermediate React Native course featured in this preview video. Here's what you'd learn in this lesson:

Kadi answers a student's question regarding what are important things to consider when trying to build a scalable app.

Get Unlimited Access Now

Transcript from the "Scalability Q&A" Lesson

>> Can you ask her the main important things that she would consider when trying to build a scalable app as far as like implementing new features and a bigger app?
>> I think the the core thing to think about is your folder structure and, setting up your app layout to scale, if that makes sense?

[00:00:21] So for example, these things here, so technically, I could have [INAUDIBLE] a navigation, Technically I could have just added everything in one app TSX it would have worked. So the reason for pulling all of these out so each screen has its own component and each Navigator has its own component is to make it scalable.

[00:00:41] So that in a production app, so in my current app that I'm building, we have maybe 30 screens, or even more. And because each of them have their own screen, it's easy to navigate between them. And say for components kind of having conventions in your code base is super, super important.

[00:01:00] So one of the things for me is for components, I like to have the component directory as flat as possible. So there's no nesting of like, these are UI components or like these are text components. So These are button components is completely flat, So if someone gets on boarded onto your code base, they can just look at these components and they know like, what's what's going on.

[00:01:26] In terms of like scalability for, like performance, There's performance tracking tools on iOS, on Xcode and Android. They can help you track down memory leaks and long running processes In terms of data management where things with context in particular, is. Basically, context will like, all the components that listen to your context, when this context value changes, all of these components that are listening to it will rerender.

[00:02:05] So you need to be kind of weary when using context of only wrapping the context around the parts of the app that need it. But also it's better to have lots of small contexts than one huge one, Right? So for example usually you'd have a context ,provided just for theming or just for authentication.

[00:02:30] So even though in app, in your main entry point, it might create this pyramid layout which people like joking about from a performance point of view that's better than having one context that has everything in it.